diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-05-23 11:08:47 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-05-23 11:15:46 +0100 |
commit | e69c155ade49d196491f1d9c96c161b71bb34010 (patch) | |
tree | 8bfcf9848e6033d3c13c93e2c89dd693639181b0 /gv.c | |
parent | ae8ade652800905bd8590e000023dd965b1b766b (diff) | |
download | perl-e69c155ade49d196491f1d9c96c161b71bb34010.tar.gz |
Move the code to add magic to $0 into Perl_gv_fetchpvn_flags().
Curiously, this appears to always have been implemented slightly inefficiently.
It dates from perl 4.000, which added the functionality to make assigning to $0
set the process name. The equivalent fix for 4.000 is:
--- a/perl.c
+++ b/perl.c
@@ -738,7 +738,7 @@ FIX YOUR KERNEL, PUT A C WRAPPER AROUND THIS SCRIPT, OR USE -u AND UNDUMP!\n");
(void)hadd(sigstab);
}
- magicalize("!#?^~=-%.+&*()<>,\\/[|`':\004\t\020\024\027\006");
+ magicalize("!#?^~=-%.+&*()<>,\\/[|`':0\004\t\020\024\027\006");
userinit(); /* in case linked C routines want magical variables */
amperstab = stabent("&",allstabs);
@@ -828,7 +828,6 @@ FIX YOUR KERNEL, PUT A C WRAPPER AROUND THIS SCRIPT, OR USE -u AND UNDUMP!\n");
#endif
if (tmpstab = stabent("0",allstabs)) {
str_set(stab_val(tmpstab),origfilename);
- magicname("0", Nullch, 0);
}
if (tmpstab = stabent("\030",allstabs))
str_set(stab_val(tmpstab),origargv[0]);
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -1394,6 +1394,7 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags, ro_magicalize: SvREADONLY_on(GvSVn(gv)); /* FALL THROUGH */ + case '0': case '1': case '2': case '3': |