From: Jan Dubois Date: Thu, 27 Nov 2003 21:09:51 +0000 (-0800) Subject: setting $0 still broken X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ad7eccf4e20fc02a9040decd348da03cb4b3de1a;p=p5sagit%2Fp5-mst-13.2.git setting $0 still broken Message-ID: p4raw-id: //depot/perl@21833 --- diff --git a/mg.c b/mg.c index 92aa03f..efdd61e 100644 --- a/mg.c +++ b/mg.c @@ -2408,7 +2408,6 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) /* Longer than original, will be truncated. We assume that * PL_origalen bytes are available. */ Copy(s, PL_origargv[0], PL_origalen-1, char); - PL_origargv[0][PL_origalen-1] = 0; } else { /* Shorter than original, will be padded. */ @@ -2421,9 +2420,10 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) * --jhi */ (int)' ', PL_origalen - len - 1); - for (i = 1; i < PL_origargc; i++) - PL_origargv[i] = 0; } + PL_origargv[0][PL_origalen-1] = 0; + for (i = 1; i < PL_origargc; i++) + PL_origargv[i] = 0; UNLOCK_DOLLARZERO_MUTEX; break; #endif