Change 27451 by [EMAIL PROTECTED] on 2006/03/09 21:49:20
Avoid scribbling on the passed in command line string for -i in
moreswitches.
Affected files ...
... //depot/perl/perl.c#742 edit
Differences ...
==== //depot/perl/perl.c#742 (text) ====
Index: perl/perl.c
--- perl/perl.c#741~27428~ 2006-03-08 14:36:30.000000000 -0800
+++ perl/perl.c 2006-03-09 13:49:20.000000000 -0800
@@ -3104,13 +3104,17 @@
return s+1;
}
#endif /* __CYGWIN__ */
- PL_inplace = savepv(s+1);
- for (s = PL_inplace; *s && !isSPACE(*s); s++)
- ;
+ {
+ const char *start = ++s;
+ while (*s && !isSPACE(*s))
+ ++s;
+
+ PL_inplace = savepvn(start, s - start);
+ }
if (*s) {
- *s++ = '\0';
+ ++s;
if (*s == '-') /* Additional switches on #! line. */
- s++;
+ s++;
}
return s;
case 'I': /* -I handled both here and in parse_body() */
End of Patch.