summaryrefslogtreecommitdiff
path: root/vms
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2014-03-08 18:35:49 -0600
committerCraig A. Berry <craigberry@mac.com>2014-03-10 07:15:17 -0500
commit6e2e048be95a027035f83c0f673f8de94e013c87 (patch)
tree6507d7a8271d4a7e674673a1fff2061ccaf1bf81 /vms
parent12cc68332009883c2ff280c630d124c9c065a107 (diff)
downloadperl-6e2e048be95a027035f83c0f673f8de94e013c87.tar.gz
Handle "no versions" feature in fileify and tovmsspec.
This is a follow-up to d5e61aaf9d7051b136, where we stopped escaping semicolons in tovmsspec when they appeared to be the beginning of a version specification but always escaped them otherwise. It turns out there is yet another CRTL feature logical name (DECC$FILENAME_UNIX_NO_VERSION) that tells us a Unix-format specification is not allowed to have a version number, so in that case, always escape the semicolon since it can't be the start of a version specification. Also, don't add the version number when fileifying directory specs if this "no versions" feature is in effect.
Diffstat (limited to 'vms')
-rw-r--r--vms/vms.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/vms/vms.c b/vms/vms.c
index b94d29315b..324cfa1092 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -6130,9 +6130,11 @@ int_fileify_dirspec(const char *dir, char *buf, int *utf8_fl)
/* We've picked up everything up to the directory file name.
Now just add the type and version, and we're set. */
if ((!decc_efs_case_preserve) && vms_process_case_tolerant)
- strcat(buf,".dir;1");
+ strcat(buf,".dir");
else
- strcat(buf,".DIR;1");
+ strcat(buf,".DIR");
+ if (!decc_filename_unix_no_version)
+ strcat(buf,";1");
PerlMem_free(trndir);
PerlMem_free(vmsdir);
return buf;
@@ -8298,7 +8300,6 @@ 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)
@@ -8705,12 +8706,17 @@ static char *int_tovmsspec
break;
case ';':
/* If it doesn't look like the beginning of a version number,
+ * or we've been promised there are no version numbers, then
* escape it.
*/
- all_nums = strspn(cp2+1, "0123456789");
- if (all_nums > 5 || *(cp2 + all_nums + 1) != '\0') {
+ if (decc_filename_unix_no_version) {
*(cp1++) = '^';
}
+ else {
+ size_t all_nums = strspn(cp2+1, "0123456789");
+ if (all_nums > 5 || *(cp2 + all_nums + 1) != '\0')
+ *(cp1++) = '^';
+ }
*(cp1++) = *(cp2++);
break;
default: