diff options
author | Craig A. Berry <craigberry@mac.com> | 2014-03-06 18:39:18 -0600 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2014-03-06 18:39:18 -0600 |
commit | d5e61aaf9d7051b13636e9a4002cf6b4a47f6d78 (patch) | |
tree | 8f4424c922f758c1e412c53866a0a8702714804a /vms/vms.c | |
parent | de29d7249495cfea30847f736f3c068ce6844596 (diff) | |
download | perl-d5e61aaf9d7051b13636e9a4002cf6b4a47f6d78.tar.gz |
Smarter handling of escaped semicolons in vmsify.
In theory, a Unix-format filespec can contain a semicolon and thus
need to be escaped when converted to a VMS-format filespec. But
a much more common use case is a filespec that has a version
number despite being in Unix format.
So detect a semicolon that delimits a version specification and
pass it through but escape other semicolons. This is apparently
what decc$to_vms does, so we're being consistent with the CRTL.
Diffstat (limited to 'vms/vms.c')
-rw-r--r-- | vms/vms.c | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -8298,6 +8298,7 @@ static char *int_tovmsspec int no_type_seen; char * v_spec, * r_spec, * d_spec, * n_spec, * e_spec, * vs_spec; int sts, v_len, r_len, d_len, n_len, e_len, vs_len; + size_t all_nums; if (vms_debug_fileify) { if (path == NULL) @@ -8703,14 +8704,11 @@ static char *int_tovmsspec *(cp1++) = *(cp2++); break; case ';': - /* FIXME: This needs fixing as Perl is putting ".dir;" on UNIX filespecs - * which is wrong. UNIX notation should be ".dir." unless - * the DECC$FILENAME_UNIX_NO_VERSION is enabled. - * changing this behavior could break more things at this time. - * efs character set effectively does not allow "." to be a version - * delimiter as a further complication about changing this. - */ - if (decc_filename_unix_report != 0) { + /* If it doesn't look like the beginning of a version number, + * escape it. + */ + all_nums = strspn(cp2+1, "0123456789"); + if (all_nums > 5 || *(cp2 + all_nums + 1) != '\0') { *(cp1++) = '^'; } *(cp1++) = *(cp2++); |