summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2017-01-14 14:44:15 -0600
committerCraig A. Berry <craigberry@mac.com>2017-01-14 16:33:43 -0600
commit1d86dd2f9a6c95dbe3230acac995ec2205513b0d (patch)
tree6a3294a5fd3d77575368fc463cd42b0706a017bb
parent30d6839e766e18ae18b768d016d3376c92bb3a9b (diff)
downloadperl-1d86dd2f9a6c95dbe3230acac995ec2205513b0d.tar.gz
Don't escape tilde when converting to VMS filespecs.
There is only one use case for requiring a tilde to be escaped, and that is when it is the first character in a file or directory component and is *not* an indication of a special shell expansion such as the user's home directory. This scenario simply can't come up when translating a Unix-format path to VMS format, so there is nothing to be gained by escaping. Escaping things we don't need to runs afoul of other goofy things people do with filenames. Test2 encodes data in tilde-delimited temporary filenames and uses a naive join and split to manipulate the components. Adding a caret escape to each component is a data corruption in this scheme, and this patch fixes test failures in Test2 without any changes to that module.
-rw-r--r--vms/vms.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/vms/vms.c b/vms/vms.c
index d1a89cdc4d..efe7f4554c 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -483,7 +483,6 @@ copy_expand_unix_filename_escape(char *outspec, const char *inspec, int *output_
return 1;
break;
case '.':
- case '~':
case '!':
case '#':
case '&':
@@ -505,7 +504,7 @@ copy_expand_unix_filename_escape(char *outspec, const char *inspec, int *output_
/* Don't escape again if following character is
* already something we escape.
*/
- if (strchr(".~!#&\'`()+@{},;[]%^=_\\", *(inspec+1))) {
+ if (strchr(".!#&\'`()+@{},;[]%^=_\\", *(inspec+1))) {
*outspec = *inspec;
*output_cnt = 1;
return 1;
@@ -8335,7 +8334,6 @@ posix_to_vmsspec_hardway(char *vmspath, int vmspath_len, const char *unixpath,
vmsptr += out_cnt;
unixptr += in_cnt;
break;
- case '~':
case ';':
case '\\':
case '?':
@@ -8789,7 +8787,6 @@ int_tovmsspec(const char *path, char *rslt, int dir_flag, int * utf8_flag)
}
break;
case '\"':
- case '~':
case '`':
case '!':
case '#':
@@ -8798,7 +8795,7 @@ int_tovmsspec(const char *path, char *rslt, int dir_flag, int * utf8_flag)
/* Don't escape again if following character is
* already something we escape.
*/
- if (strchr("\"~`!#%^&()=+\'@[]{}:\\|<>_.", *(cp2+1))) {
+ if (strchr("\"`!#%^&()=+\'@[]{}:\\|<>_.", *(cp2+1))) {
*(cp1++) = *(cp2++);
break;
}