Re: [perl #38868] Changing $0 on darwin leads to excessive padding in 'ps'
Chris Dolan [Sat, 2 Dec 2006 09:37:08 +0000 (03:37 -0600)]
Message-Id: <005671A0-5C2B-464C-85B9-A91E52278194@chrisdolan.net>

p4raw-id: //depot/perl@29446

mg.c

diff --git a/mg.c b/mg.c
index a64526e..56e8065 100644 (file)
--- 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;