In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/9e1c556683b2bf04685b75340e523e781a2342ec?hp=5e909f4bb1064c090091941ad075a132e8f63121>
- Log ----------------------------------------------------------------- commit 9e1c556683b2bf04685b75340e523e781a2342ec Author: Craig A. Berry <[email protected]> Date: Sun Jan 22 08:29:47 2012 -0600 More un-TODOs and two typos in vms/ext/filespec.t. Two tests that actually pass under Extended Filename Syntax and two that will now pass if we give them the correct expectations. M vms/ext/filespec.t commit a9fac63d75d9222a73fbf511ca58ae1d66cbf9a7 Author: Craig A. Berry <[email protected]> Date: Sun Jan 22 08:03:26 2012 -0600 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. M vms/vms.c ----------------------------------------------------------------------- Summary of changes: vms/ext/filespec.t | 8 ++++---- vms/vms.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/vms/ext/filespec.t b/vms/ext/filespec.t index 7e12e12..f5f71ce 100755 --- a/vms/ext/filespec.t +++ b/vms/ext/filespec.t @@ -122,10 +122,10 @@ __some_/__where_/... vmsify [.__some_.__where_...] ^* .. vmsify [-] ^ ../.. vmsify [--] ^ .../ vmsify [...] ^ -/ vmsify sys$disk:[000000] ^* +/ vmsify sys$disk:[000000] ^ ./$(macro)/ vmsify [.$(macro)] ^ ./$(macro) vmsify []$(macro) ^ -./$(m+ vmsify []$^(m^+ []$^(m^+. +./$(m+ vmsify []$^(m^+ ^ # Fileifying directory specs __down_:[__the_.__garden_.__path_] fileify __down_:[__the_.__garden_]__path_.dir;1 ^ @@ -145,7 +145,7 @@ __down_:[__the_.__garden_]__path_.dir;1 pathify __down_:[__the_.__garden_ /__down_/__the_/__garden_/__path_.dir pathify /__down_/__the_/__garden_/__path_/ ^ __down_/__the_/__garden_/__path_.dir pathify __down_/__the_/__garden_/__path_/ ^ __down_:[__the_.__garden_]__path_ pathify __down_:[__the_.__garden_.__path_] ^ -__down_:[__the_.__garden_]__path_. pathify ^ __down_:[__the.__garden_.__path_^.] # N.B. trailing . ==> null type +__down_:[__the_.__garden_]__path_. pathify ^ __down_:[__the_.__garden_.__path_^.] # N.B. trailing . ==> null type __down_:[__the_]__garden_.__path_ pathify ^ __down_:[__the_.__garden_^.__path_] # undef /__down_/__the_/__garden_/__path_. pathify /__down_/__the_/__garden_/__path__/ /__down_/__the_/__garden_/__path_./ # N.B. trailing . ==> null type /__down_/__the_/__garden_.__path_ pathify /__down_/__the_/__garden____path_/ /__down_/__the_/__garden_.__path_/ @@ -165,7 +165,7 @@ __down_:[__the_.__garden_.__path_...] unixpath /__down_/__the_/__garden_ [.__down_.__the_.__garden_]__path_.dir unixpath __down_/__the_/__garden_/__path_/ ^ __down_/__the_/__garden_/__path_ vmspath [.__down_.__the_.__garden_.__path_] ^ __path_ vmspath [.__path_] ^ -/ vmspath sys$disk:[000000] ^* +/ vmspath sys$disk:[000000] ^ /sys$scratch vmspath sys$scratch: ^ # Redundant characters in Unix paths diff --git a/vms/vms.c b/vms/vms.c index 4f69ec5..9d3ed12 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++; + } + } + } + } } } -- Perl5 Master Repository
