From: Chris Dolan <chris@chrisdolan.net>
Date: Sat, 2 Dec 2006 09:37:08 +0000 (-0600)
Subject: Re: [perl #38868] Changing $0 on darwin leads to excessive padding in 'ps'
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=235ac35db87eeb01f0e613de4bd82180b6fa10e8;p=p5sagit%2Fp5-mst-13.2.git

Re: [perl #38868] Changing $0 on darwin leads to excessive padding in 'ps'
Message-Id: <005671A0-5C2B-464C-85B9-A91E52278194@chrisdolan.net>

p4raw-id: //depot/perl@29446
---

diff --git a/mg.c b/mg.c
index a64526e..56e8065 100644
--- a/mg.c
+++ b/mg.c
@@ -2632,11 +2632,16 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
 		Copy(s, PL_origargv[0], len, char);
 		PL_origargv[0][len] = 0;
 		memset(PL_origargv[0] + len + 1,
+#ifdef PERL_DARWIN
+		       /* Special case for darwin: see [perl #38868] */
+		       (int)'\0',
+#else
 		       /* Is the space counterintuitive?  Yes.
-			* (You were expecting \0?)  
+			* (You were expecting \0?)
 			* Does it work?  Seems to.  (In Linux 2.4.20 at least.)
 			* --jhi */
 		       (int)' ',
+#endif
 		       PL_origalen - len - 1);
 	    }
 	    PL_origargv[0][PL_origalen-1] = 0;