In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/f401ac158eb0a92eccfb544c5b7589a6bf8404a6?hp=abdf340104c29dbd310ff3e2102fb061a7a1f925>
- Log ----------------------------------------------------------------- commit f401ac158eb0a92eccfb544c5b7589a6bf8404a6 Author: Craig A. Berry <[email protected]> Date: Mon May 4 21:25:05 2015 -0500 Fix unixify when beginning with current directory. VMS::Filespec::unixify has been truncating its return value and returning early when the input begins with [] meaning the current directory. If there was nothing else, we've been getting the right answer: [] --> ./ but if there was a file portion of the name it's been getting omitted: []foo.txt --> ./ which is now fixed. Looks like it's been broken since inception in 5.002, though only with the specific [] case and not if there was an explicit device or directory name. ----------------------------------------------------------------------- Summary of changes: ext/VMS-Filespec/t/filespec.t | 3 +++ vms/vms.c | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ext/VMS-Filespec/t/filespec.t b/ext/VMS-Filespec/t/filespec.t index f556703..6d421e1 100644 --- a/ext/VMS-Filespec/t/filespec.t +++ b/ext/VMS-Filespec/t/filespec.t @@ -110,6 +110,7 @@ __lyrics_:[__are_.__very_^.__sappy_]__but_^.__rhymes_^.__are_.__true_ unixify [.$(macro)] unixify $(macro)/ ^ ^+foo.tmp unixify +foo.tmp ^ [-.foo^_^_bar] unixify ../foo\ \ bar/ ^ +[]foo.tmp unixify ./foo.tmp ^ # and back again /__some_/__where_/__over_/__the_.__rainbow_ vmsify __some_:[__where_.__over_]__the_.__rainbow_ ^ @@ -135,6 +136,8 @@ foo-bar-0^.01/ vmsify [.foo-bar-0_01] [.foo-bar-0^.01] \ foo.tmp vmsify ^_foo.tmp ^ +foo.tmp vmsify ^+foo.tmp ^ ../foo\ \ bar/ vmsify [-.foo^_^_bar] ^ +./foo.tmp vmsify []foo.tmp ^ + # Fileifying directory specs __down_:[__the_.__garden_.__path_] fileify __down_:[__the_.__garden_]__path_.dir;1 ^ [.__down_.__the_.__garden_.__path_] fileify [.__down_.__the_.__garden_]__path_.dir;1 ^ diff --git a/vms/vms.c b/vms/vms.c index 0364415..953d8b8 100644 --- a/vms/vms.c +++ b/vms/vms.c @@ -7073,9 +7073,8 @@ int_tounixspec(const char *spec, char *rslt, int * utf8_fl) else { /* the VMS spec begins with directories */ cp2++; if (*cp2 == ']' || *cp2 == '>') { - *(cp1++) = '.'; *(cp1++) = '/'; *(cp1++) = '\0'; - PerlMem_free(tmp); - return rslt; + *(cp1++) = '.'; + *(cp1++) = '/'; } else if ( *cp2 != '^' && *cp2 != '.' && *cp2 != '-') { /* add the implied device */ if (getcwd(tmp, VMS_MAXRSS-1 ,1) == NULL) { -- Perl5 Master Repository
