summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2016-09-04 21:10:06 -0500
committerCraig A. Berry <craigberry@mac.com>2016-09-05 08:17:00 -0500
commit83269cedf6d56458a3fbea611ea3c56c444bde50 (patch)
tree925eea6f4f5e92ba4fd346e975b6adcb300f7644 /mg.c
parent4ad0d3b9f11b33230f285a6e28f55f54490d90d8 (diff)
downloadperl-83269cedf6d56458a3fbea611ea3c56c444bde50.tar.gz
Tainted dirs on VMS when not under DCL.
Since 483efd0abe3 the path delimiter is a ':' instead of '|' on VMS when running under a Unix shell. So use that as a guide to whether we should use a colon or a slash to detect relative directories that should be tainted.
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mg.c b/mg.c
index 8b182e6f24..85e31751cf 100644
--- a/mg.c
+++ b/mg.c
@@ -1212,8 +1212,8 @@ Perl_magic_setenv(pTHX_ SV *sv, MAGIC *mg)
char tmpbuf[256];
Stat_t st;
I32 i;
-#ifdef VMS /* Hmm. How do we get $Config{path_sep} from C? */
- const char path_sep = '|';
+#ifdef __VMS /* Hmm. How do we get $Config{path_sep} from C? */
+ const char path_sep = PL_perllib_sep;
#else
const char path_sep = ':';
#endif
@@ -1221,8 +1221,11 @@ Perl_magic_setenv(pTHX_ SV *sv, MAGIC *mg)
s, strend, path_sep, &i);
s++;
if (i >= (I32)sizeof tmpbuf /* too long -- assume the worst */
-#ifdef VMS
- || !strchr(tmpbuf, ':') /* no colon thus no device name -- assume relative path */
+#ifdef __VMS
+ /* no colon thus no device name -- assume relative path */
+ || (PL_perllib_sep != ':' && !strchr(tmpbuf, ':'))
+ /* Using Unix separator, e.g. under bash, so act line Unix */
+ || (PL_perllib_sep == ':' && *tmpbuf != '/')
#else
|| *tmpbuf != '/' /* no starting slash -- assume relative path */
#endif