summaryrefslogtreecommitdiff
path: root/vms
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2014-01-25 10:50:02 -0600
committerCraig A. Berry <craigberry@mac.com>2014-01-25 10:55:14 -0600
commit60e5a54b7c38e5e2a1346423236d205576f8234d (patch)
tree75800b569b4e1b4da54c458d474a40e37bb07c04 /vms
parent0f669c9d195bffa8ed03ffc8a452415a7246a942 (diff)
downloadperl-60e5a54b7c38e5e2a1346423236d205576f8234d.tar.gz
Make fileify handle node specifications better.
In particular, a node specification containing only a single directory (i.e., node::dev:[dir]) was not being handled properly. This came up while reproducing the problem in [perl #121002] but was not the cause of that problem as the OP's directory had multiple subdirectories in it.
Diffstat (limited to 'vms')
-rw-r--r--vms/vms.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/vms/vms.c b/vms/vms.c
index c0fa4e4211..fddd6e17e2 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -5983,6 +5983,9 @@ int_fileify_dirspec(const char *dir, char *buf, int *utf8_fl)
vmsdir = (char *)PerlMem_malloc(VMS_MAXRSS + 1);
if (vmsdir == NULL) _ckvmssts_noperl(SS$_INSFMEM);
cp1 = strpbrk(trndir,"]:>");
+ if (cp1 && *(cp1+1) == ':') /* DECNet node spec with :: */
+ cp1 = strpbrk(cp1+2,"]:>");
+
if (hasfilename || !cp1) { /* filename present or not VMS */
if (trndir[0] == '.') {
@@ -6188,7 +6191,10 @@ int_fileify_dirspec(const char *dir, char *buf, int *utf8_fl)
rms_set_nam_fnb(dirnam, (NAM$M_EXP_TYPE | NAM$M_EXP_VER));
}
else { /* No; just work with potential name */
- if (dirfab.fab$l_sts == RMS$_FNF) dirnam = savnam;
+ if (dirfab.fab$l_sts == RMS$_FNF
+ || dirfab.fab$l_sts == RMS$_DNF
+ || dirfab.fab$l_sts == RMS$_FND)
+ dirnam = savnam;
else {
int fab_sts;
fab_sts = dirfab.fab$l_sts;
@@ -6364,12 +6370,12 @@ int_fileify_dirspec(const char *dir, char *buf, int *utf8_fl)
}
}
else { /* This is a top-level dir. Add the MFD to the path. */
- cp1 = my_esa;
- cp2 = buf;
- while ((*cp1 != ':') && (*cp1 != '\0')) *(cp2++) = *(cp1++);
- strcpy(cp2,":[000000]");
- cp1 += 2;
- strcpy(cp2+9,cp1);
+ cp1 = strrchr(my_esa, ':');
+ assert(cp1);
+ memmove(buf, my_esa, cp1 - my_esa + 1);
+ memmove(buf + (cp1 - my_esa) + 1, "[000000]", 8);
+ memmove(buf + (cp1 - my_esa) + 9, cp1 + 2, retlen - (cp1 - my_esa + 2));
+ buf[retlen + 7] = '\0'; /* We've inserted '000000]' */
}
}
sts = rms_free_search_context(&dirfab);