From: Craig A. Berry Date: Fri, 16 Mar 2007 01:40:50 +0000 (+0000) Subject: Make sure escaped dots in filenames are preserved when translating X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=42cd432e78efd1039af03fb10782bd0dba2e23ee;p=p5sagit%2Fp5-mst-13.2.git Make sure escaped dots in filenames are preserved when translating filenames from VMS to UNIX syntax. p4raw-id: //depot/perl@30602 --- diff --git a/vms/ext/filespec.t b/vms/ext/filespec.t index 6c099d9..3415400 100644 --- a/vms/ext/filespec.t +++ b/vms/ext/filespec.t @@ -62,6 +62,7 @@ __some_:[__where_.__over_]__the_.__rainbow_ unixify /__some_/__where_/__over_ [-] unixify ../ [--] unixify ../../ [...] unixify .../ +__lyrics_:[__are_.__very_^.__sappy_]__but_^.__rhymes_^.__are_.__true_ unixify /__lyrics_/__are_/__very_.__sappy_/__but_.__rhymes_.__are_.__true_ # and back again /__some_/__where_/__over_/__the_.__rainbow_ vmsify __some_:[__where_.__over_]__the_.__rainbow_ diff --git a/vms/vms.c b/vms/vms.c index 9fd4485..f8f79f1 100644 --- a/vms/vms.c +++ b/vms/vms.c @@ -6094,8 +6094,9 @@ static char *mp_do_tounixspec(pTHX_ const char *spec, char *buf, int ts, int * u if ((*cp2 == '^')) { /* EFS file escape, pass the next character as is */ /* Fix me: HEX encoding for UNICODE not implemented */ - cp2++; - *(cp1++) = *cp2; + *(cp1++) = *(++cp2); + /* An escaped dot stays as is -- don't convert to slash */ + if (*cp2 == '.') cp2++; } if (*cp2 == ':') { *(cp1++) = '/'; @@ -6133,7 +6134,10 @@ static char *mp_do_tounixspec(pTHX_ const char *spec, char *buf, int ts, int * u } else *(cp1++) = *cp2; } - while (*cp2) *(cp1++) = *(cp2++); + while (*cp2) { + if ((*cp2 == '^') && (*(cp2+1) == '.')) cp2++; /* '^.' --> '.' */ + *(cp1++) = *(cp2++); + } *cp1 = '\0'; /* This still leaves /000000/ when working with a