summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-05-23 11:08:47 +0100
committerNicholas Clark <nick@ccl4.org>2009-05-23 11:15:46 +0100
commite69c155ade49d196491f1d9c96c161b71bb34010 (patch)
tree8bfcf9848e6033d3c13c93e2c89dd693639181b0 /gv.c
parentae8ade652800905bd8590e000023dd965b1b766b (diff)
downloadperl-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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gv.c b/gv.c
index 703635cabd..549d672a2a 100644
--- a/gv.c
+++ b/gv.c
@@ -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':