diff options
author | Craig A. Berry <craigberry@mac.com> | 2007-03-16 01:40:50 +0000 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2007-03-16 01:40:50 +0000 |
commit | 42cd432e78efd1039af03fb10782bd0dba2e23ee (patch) | |
tree | 801142b5ad0dc79532514a497c35384f5aa57f5d /vms | |
parent | 8ec7363a788490ed4796ca94a29acc1853cb263b (diff) | |
download | perl-42cd432e78efd1039af03fb10782bd0dba2e23ee.tar.gz |
Make sure escaped dots in filenames are preserved when translating
filenames from VMS to UNIX syntax.
p4raw-id: //depot/perl@30602
Diffstat (limited to 'vms')
-rw-r--r-- | vms/ext/filespec.t | 1 | ||||
-rw-r--r-- | vms/vms.c | 10 |
2 files changed, 8 insertions, 3 deletions
diff --git a/vms/ext/filespec.t b/vms/ext/filespec.t index 6c099d9612..3415400b21 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_ @@ -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 |