summaryrefslogtreecommitdiff
path: root/vms
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2007-03-16 01:40:50 +0000
committerCraig A. Berry <craigberry@mac.com>2007-03-16 01:40:50 +0000
commit42cd432e78efd1039af03fb10782bd0dba2e23ee (patch)
tree801142b5ad0dc79532514a497c35384f5aa57f5d /vms
parent8ec7363a788490ed4796ca94a29acc1853cb263b (diff)
downloadperl-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.t1
-rw-r--r--vms/vms.c10
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_
diff --git a/vms/vms.c b/vms/vms.c
index 9fd44859a8..f8f79f1449 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