summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2006-12-12 17:18:53 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-12-12 13:32:01 +0000
commit60777a0ddefff116b2ee80376468ae1812a47dcc (patch)
treed56fb693bbbbd9440c3e36fb6accf936a60cfc05 /mg.c
parent8a89a4f1bb82cfdcf0d60fe79d4a46789692b97f (diff)
downloadperl-60777a0ddefff116b2ee80376468ae1812a47dcc.tar.gz
mg.c: #ifdef only the different bits
Message-Id: <20061212131853.C2CBA43A67@anubis.hut.fi> p4raw-id: //depot/perl@29531
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mg.c b/mg.c
index 611bb4eaa7..450196bfb9 100644
--- a/mg.c
+++ b/mg.c
@@ -2629,20 +2629,20 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
}
else {
/* Shorter than original, will be padded. */
- Copy(s, PL_origargv[0], len, char);
- PL_origargv[0][len] = 0;
#ifdef PERL_DARWIN
- /* Special case for darwin: see [perl #38868] */
- memset(PL_origargv[0] + len + 1,
- (int)'\0', PL_origalen - len - 1);
+ /* Special case for Mac OS X: see [perl #38868] */
+ const int pad = 0;
#else
/* Is the space counterintuitive? Yes.
* (You were expecting \0?)
* Does it work? Seems to. (In Linux 2.4.20 at least.)
* --jhi */
- memset(PL_origargv[0] + len + 1,
- (int)' ', PL_origalen - len - 1);
+ const int pad = ' ';
#endif
+ Copy(s, PL_origargv[0], len, char);
+ PL_origargv[0][len] = 0;
+ memset(PL_origargv[0] + len + 1,
+ pad, PL_origalen - len - 1);
}
PL_origargv[0][PL_origalen-1] = 0;
for (i = 1; i < PL_origargc; i++)