This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Suppress confusing uninit warning from -T _
[perl5.git] / doio.c
diff --git a/doio.c b/doio.c
index 06d9bcd..47b60ce 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -2379,7 +2379,13 @@ Perl_vms_start_glob
 #endif
 #endif /* !CSH */
 #endif /* !DOSISH */
-    save_hash(gv_fetchpvs("ENV", 0, SVt_PVHV));
+    {
+       GV * const envgv = gv_fetchpvs("ENV", 0, SVt_PVHV);
+       SV ** const home = hv_fetchs(GvHV(envgv), "HOME", 0);
+       if (home && *home) SvGETMAGIC(*home);
+       save_hash(gv_fetchpvs("ENV", 0, SVt_PVHV));
+       if (home && *home) SvSETMAGIC(*home);
+    }
     (void)do_open(PL_last_in_gv, (char*)SvPVX_const(tmpcmd), SvCUR(tmpcmd),
                  FALSE, O_RDONLY, 0, NULL);
     fp = IoIFP(io);