summaryrefslogtreecommitdiff
path: root/vms/vms.c
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2012-12-04 07:23:57 -0600
committerCraig A. Berry <craigberry@mac.com>2012-12-04 07:23:57 -0600
commitc434e88d3bead3f9417903defe6f23a1ad0ca522 (patch)
treea604b1492b56d5b1f97a4dbc72183311bf1476ab /vms/vms.c
parent4a9a56a75c57646b348598f90875415e994d2f65 (diff)
downloadperl-c434e88d3bead3f9417903defe6f23a1ad0ca522.tar.gz
Avoid some doubled escapes in tovmsspec.
Since it's impossible to guarantee a filename is never makes multiple trips through the Unix-to-VMS converter, it's important not to escape characters that have already been escaped.
Diffstat (limited to 'vms/vms.c')
-rw-r--r--vms/vms.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/vms/vms.c b/vms/vms.c
index 43496efcfe..b3201a44fc 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -8582,7 +8582,8 @@ static char *int_tovmsspec
*(cp1++) = '?';
cp2++;
case ' ':
- *(cp1)++ = '^';
+ if (cp2 > path && *(cp2-1) != '^') /* not previously escaped */
+ *(cp1)++ = '^';
*(cp1)++ = '_';
cp2++;
break;
@@ -8666,7 +8667,8 @@ static char *int_tovmsspec
case '|':
case '<':
case '>':
- *(cp1++) = '^';
+ if (cp2 > path && *(cp2-1) != '^') /* not previously escaped */
+ *(cp1++) = '^';
*(cp1++) = *(cp2++);
break;
case ';':