Oops. Didn't mean to commit 27426 to maint first. Integrate it:
Nicholas Clark [Wed, 8 Mar 2006 21:53:06 +0000 (21:53 +0000)]
Avoid writing over the input string in the case 'F' in moreswitches.

p4raw-id: //depot/perl@27427
p4raw-integrated: from //depot/maint-5.8/perl@27425 'merge in' perl.c
(@27318..)

perl.c

diff --git a/perl.c b/perl.c
index a931a78..0ad1e00 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -3010,8 +3010,7 @@ Perl_moreswitches(pTHX_ char *s)
        PL_minus_F = TRUE;
        PL_splitstr = ++s;
        while (*s && !isSPACE(*s)) ++s;
-       *s = '\0';
-       PL_splitstr = savepv(PL_splitstr);
+       PL_splitstr = savepvn(PL_splitstr, s - PL_splitstr);
        return s;
     case 'a':
        PL_minus_a = TRUE;