diff options
author | Craig A. Berry <craigberry@mac.com> | 2012-01-22 08:03:26 -0600 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2012-01-23 18:42:15 -0600 |
commit | a9fac63d75d9222a73fbf511ca58ae1d66cbf9a7 (patch) | |
tree | 7fda0b2a1802c0b0076a3f2e65e0bb6f7ddf9964 /vms/vms.c | |
parent | 5e909f4bb1064c090091941ad075a132e8f63121 (diff) | |
download | perl-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/vms.c')
-rw-r--r-- | vms/vms.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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++; + } + } + } + } } } |