This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix start-of-string error in tovmsspec.
authorCraig A. Berry <craigberry@mac.com>
Mon, 29 Sep 2014 02:04:54 +0000 (21:04 -0500)
committerCraig A. Berry <craigberry@mac.com>
Mon, 29 Sep 2014 02:04:54 +0000 (21:04 -0500)
When translating a filespec starting with an extended character,
say C<+foo>, from Unix to VMS format, we were inadvertently
skipping over the first character and thus not translating it to
C<^+foo> with the caret escape prepended to the plus sign as we
should have been.

This fixes a fairly new test failure in ExtUtils::Manifest where
a filename starts with a single quote.

ext/VMS-Filespec/t/filespec.t
vms/vms.c

index c14ce99..0f31f85 100644 (file)
@@ -106,6 +106,7 @@ __some_:<__where_.__over_>__the_.__rainbow_    unixify /__some_/__where_/__over_
 [...]  unixify         .../    ^
 __lyrics_:[__are_.__very_^.__sappy_]__but_^.__rhymes_^.__are_.__true_    unixify   /__lyrics_/__are_/__very_.__sappy_/__but_.__rhymes_.__are_.__true_ ^
 [.$(macro)]    unixify $(macro)/ ^
+^+foo.tmp      unixify +foo.tmp ^
 
 # and back again
 /__some_/__where_/__over_/__the_.__rainbow_    vmsify  __some_:[__where_.__over_]__the_.__rainbow_ ^
@@ -129,6 +130,7 @@ __some_/__where_/...   vmsify  [.__some_.__where_...] ^
 ./$(m+ vmsify  []$^(m^+        ^
 foo-bar-0^.01/ vmsify [.foo-bar-0_01] [.foo-bar-0^.01]
 \ foo.tmp      vmsify ^_foo.tmp ^
++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 ^
index 75e4cce..cca6c48 100644 (file)
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -8695,7 +8695,7 @@ static char *int_tovmsspec
     case '|':
     case '<':
     case '>':
-       if (cp2 > path && *(cp2-1) != '^') /* not previously escaped */
+       if (cp2 >= path && *(cp2-1) != '^') /* not previously escaped */
            *(cp1++) = '^';
        *(cp1++) = *(cp2++);
        break;