From: alexander_bluhm@genua.de Date: Tue, 28 Nov 2006 05:09:31 +0000 (-0800) Subject: [perl #41008] Setting $0 invalidates environment shown by ps X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9d3968b272fe0ca6f9e4110df961b705d4665965;p=p5sagit%2Fp5-mst-13.2.git [perl #41008] Setting $0 invalidates environment shown by ps From: alexander_bluhm@genua.de (via RT) Message-ID: p4raw-id: //depot/perl@29416 --- diff --git a/mg.c b/mg.c index 925ece3..a64526e 100644 --- a/mg.c +++ b/mg.c @@ -2611,15 +2611,14 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) setproctitle("%s", s); # endif } -#endif -#if defined(__hpux) && defined(PSTAT_SETCMD) +#elif defined(__hpux) && defined(PSTAT_SETCMD) if (PL_origalen != 1) { union pstun un; s = SvPV_const(sv, len); un.pst_command = (char *)s; pstat(PSTAT_SETCMD, un, len, 0, 0); } -#endif +#else if (PL_origalen > 1) { /* PL_origalen is set in perl_parse(). */ s = SvPV_force(sv,len); @@ -2644,6 +2643,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) for (i = 1; i < PL_origargc; i++) PL_origargv[i] = 0; } +#endif UNLOCK_DOLLARZERO_MUTEX; break; #endif