From e297595301ee5f3b0643be0fb1fffae9b6b548a0 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Sat, 30 Nov 2002 22:16:51 +0200 Subject: $0 mofifying part I Subject: [PATCH] $0 modifying Message-ID: <20021130181651.GA5876@kosh.hut.fi> p4raw-id: //depot/perl@18229 --- perl.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'perl.c') diff --git a/perl.c b/perl.c index 11da3153c5..bc0c28b55d 100644 --- a/perl.c +++ b/perl.c @@ -489,11 +489,6 @@ perl_destruct(pTHXx) PL_e_script = Nullsv; } - while (--PL_origargc >= 0) { - Safefree(PL_origargv[PL_origargc]); - } - Safefree(PL_origargv); - /* magical thingies */ SvREFCNT_dec(PL_ofs_sv); /* $, */ @@ -897,21 +892,7 @@ setuid perl scripts securely.\n"); #endif PL_origargc = argc; - { - /* we copy rather than point to argv - * since perl_clone will copy and perl_destruct - * has no way of knowing if we've made a copy or - * just point to argv - */ - int i = PL_origargc; - New(0, PL_origargv, i+1, char*); - PL_origargv[i] = '\0'; - while (i-- > 0) { - PL_origargv[i] = savepv(argv[i]); - } - } - - + PL_origargv = argv; if (PL_do_undump) { @@ -937,6 +918,10 @@ setuid perl scripts securely.\n"); oldscope = PL_scopestack_ix; PL_dowarn = G_WARN_OFF; +#ifdef USE_ITHREADS + MUTEX_INIT(&PL_dollarzero_mutex); +#endif + #ifdef PERL_FLEXIBLE_EXCEPTIONS CALLPROTECT(aTHX_ pcur_env, &ret, MEMBER_TO_FPTR(S_vparse_body), env, xsinit); #else -- cgit v1.2.1