[perl #113798] Don’t hide PATH from perlglob
authorFather Chrysostomos <sprout@cpan.org>
Sat, 23 Jun 2012 16:34:26 +0000 (09:34 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 23 Jun 2012 16:34:26 +0000 (09:34 -0700)
To fix another bug, miniperl was changed to clear out %ENV before
shelling out to call the underlying glob program (csh on Unix;
perlglob on Windows), in commit a3342be368.

That proved slightly problematic, as it stopped <~> from working on
Unix, so commit 93b2dae1 changed it to preserve just $ENV{HOME}.

That turns out not to have been enough.  For some compilers, Win-
dows needs PATH preserved for perlglob to find certain DLLs it
needs to load.

doio.c

diff --git a/doio.c b/doio.c
index fed1a49..f770fc1 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -2387,9 +2387,12 @@ Perl_vms_start_glob
     {
        GV * const envgv = gv_fetchpvs("ENV", 0, SVt_PVHV);
        SV ** const home = hv_fetchs(GvHV(envgv), "HOME", 0);
+       SV ** const path = hv_fetchs(GvHV(envgv), "PATH", 0);
        if (home && *home) SvGETMAGIC(*home);
+       if (path && *path) SvGETMAGIC(*path);
        save_hash(gv_fetchpvs("ENV", 0, SVt_PVHV));
        if (home && *home) SvSETMAGIC(*home);
+       if (path && *path) SvSETMAGIC(*path);
     }
     (void)do_open(PL_last_in_gv, (char*)SvPVX_const(tmpcmd), SvCUR(tmpcmd),
                  FALSE, O_RDONLY, 0, NULL);