summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2006-06-02 23:18:08 +0000
committerCraig A. Berry <craigberry@mac.com>2006-06-02 23:18:08 +0000
commit326b5008ebd8d91bf6b00d96127d2d711c9f2132 (patch)
tree4a6d0f4da209432277f18b6139eca7cb7ea7dff2 /mg.c
parenteee4b3e7bdad6a2c6ef0e7ee1f43200ab0fd25bb (diff)
downloadperl-326b5008ebd8d91bf6b00d96127d2d711c9f2132.tar.gz
It's all relative -- better handling of tainted directories
in PATH on VMS (and scrubbing them in t/test.pl). p4raw-id: //depot/perl@28348
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/mg.c b/mg.c
index 041a09e01c..4957a711a2 100644
--- a/mg.c
+++ b/mg.c
@@ -1103,10 +1103,20 @@ Perl_magic_setenv(pTHX_ SV *sv, MAGIC *mg)
Stat_t st;
I32 i;
s = delimcpy(tmpbuf, tmpbuf + sizeof tmpbuf,
- s, strend, ':', &i);
+ s, strend,
+#ifdef VMS
+ '|', /* Hmm. How do we get $Config{path_sep} from C? */
+#else
+ ':',
+#endif
+ &i);
s++;
if (i >= (I32)sizeof tmpbuf /* too long -- assume the worst */
- || *tmpbuf != '/'
+#ifdef VMS
+ || !strchr(tmpbuf, ':') /* no colon thus no device name -- assume relative path */
+#else
+ || *tmpbuf != '/' /* no starting slash -- assume relative path */
+#endif
|| (PerlLIO_stat(tmpbuf, &st) == 0 && (st.st_mode & 2)) ) {
MgTAINTEDDIR_on(mg);
return 0;