summaryrefslogtreecommitdiff
path: root/vms
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2012-01-22 08:03:26 -0600
committerCraig A. Berry <craigberry@mac.com>2012-01-23 18:42:15 -0600
commita9fac63d75d9222a73fbf511ca58ae1d66cbf9a7 (patch)
tree7fda0b2a1802c0b0076a3f2e65e0bb6f7ddf9964 /vms
parent5e909f4bb1064c090091941ad075a132e8f63121 (diff)
downloadperl-a9fac63d75d9222a73fbf511ca58ae1d66cbf9a7.tar.gz
Handle directories with dots in fileify under EFS.
When Extended Filename Syntax (EFS) is in effect, it's legal for directory names to contain dots that are not directory delimiters. This commit escapes such dots when they are part of the file portion of the fileified directory spec. This gets two more of the vms/ext/filespec.t tests passing when EFS is in effect.
Diffstat (limited to 'vms')
-rw-r--r--vms/vms.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/vms/vms.c b/vms/vms.c
index 4f69ec52f7..9d3ed12381 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -6133,6 +6133,20 @@ int_fileify_dirspec(const char *dir, char *buf, int *utf8_fl)
/* The .dir for now, and fix this better later */
dirlen = cp2 - trndir;
}
+ if (decc_efs_charset) {
+ /* Dots are allowed in dir names, so escape them. */
+ char *cp4 = is_dir ? (cp2 - 1) : cp2;
+
+ for (; cp4 > cp1; cp4--) {
+ if (*cp4 == '.') {
+ if ((cp4 - 1 > trndir) && (*(cp4 - 1) != '^')) {
+ memmove(cp4 + 1, cp4, trndir + dirlen - cp4 + 1);
+ *cp4 = '^';
+ dirlen++;
+ }
+ }
+ }
+ }
}
}