[patch@28427] vms.c - null termination of string missing.
John E. Malmberg [Mon, 26 Jun 2006 08:24:57 +0000 (04:24 -0400)]
From: "John E. Malmberg" <wb8tyw@qsl.net>
Message-ID: <449FD219.5060900@qsl.net>

p4raw-id: //depot/perl@28429

vms/vms.c

index 8a30a55..62b17a0 100644 (file)
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -5148,6 +5148,7 @@ static char *mp_do_fileify_dirspec(pTHX_ const char *dir,char *buf,int ts, int *
           }
         }
       }
+      esa[rms_nam_esll(dirnam)] = '\0';
       if (!rms_is_nam_fnb(dirnam, (NAM$M_EXP_DEV | NAM$M_EXP_DIR))) {
         cp1 = strchr(esa,']');
         if (!cp1) cp1 = strchr(esa,'>');
@@ -5170,7 +5171,7 @@ static char *mp_do_fileify_dirspec(pTHX_ const char *dir,char *buf,int ts, int *
           return NULL;
         }
       }
-      esa[rms_nam_esll(dirnam)] = '\0';
+
       if (rms_is_nam_fnb(dirnam, NAM$M_EXP_NAME)) {
         /* They provided at least the name; we added the type, if necessary, */
         if (buf) retspec = buf;                            /* in sys$parse() */