summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorGisle Aas <gisle@activestate.com>2006-01-11 09:52:18 +0000
committerGisle Aas <gisle@activestate.com>2006-01-11 09:52:18 +0000
commita2722ac963c473daf784eb7bed19dab587ac5fe6 (patch)
treef27669fcacf60c3d00a4728fd26e8c55b50264a2 /perl.c
parent7b3f41f48f08e2c852bc36ce5a178ec9102a33f7 (diff)
downloadperl-a2722ac963c473daf784eb7bed19dab587ac5fe6.tar.gz
Make setting 'PL_origalen = 1' before perl_parse() disable
argv[0] munging when $0 is assigned to. p4raw-id: //depot/perl@26779
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/perl.c b/perl.c
index b1671d956d..295859953c 100644
--- a/perl.c
+++ b/perl.c
@@ -1439,7 +1439,10 @@ setuid perl scripts securely.\n");
PL_origargc = argc;
PL_origargv = argv;
- {
+ if (PL_origalen != 0) {
+ PL_origalen = 1; /* don't use old PL_origalen if perl_parse() is called again */
+ }
+ else {
/* Set PL_origalen be the sum of the contiguous argv[]
* elements plus the size of the env in case that it is
* contiguous with the argv[]. This is used in mg.c:Perl_magic_set()