summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-30 11:40:37 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-30 11:40:37 +0000
commitd0043bd135485a532d9aee2280acc8b2d782baa4 (patch)
tree221557e4e0e1619fa6f56f6d6112e1a560cb19ab /perl.c
parente6830b1398c4e7ce4800aa72b564ebd81702e14c (diff)
downloadperl-d0043bd135485a532d9aee2280acc8b2d782baa4.tar.gz
Replace newSVpv(...,0) with newSVpvn where we know the length.
p4raw-id: //depot/perl@25022
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/perl.c b/perl.c
index e573425f1d..56892816c2 100644
--- a/perl.c
+++ b/perl.c
@@ -3061,8 +3061,10 @@ Perl_moreswitches(pTHX_ char *s)
SV *sv;
const char *use = "use ";
/* -M-foo == 'no foo' */
- if (*s == '-') { use = "no "; ++s; }
- sv = newSVpv(use,0);
+ /* Leading space on " no " is deliberate, to make both
+ possibilities the same length. */
+ if (*s == '-') { use = " no "; ++s; }
+ sv = newSVpvn(use,4);
start = s;
/* We allow -M'Module qw(Foo Bar)' */
while(isALNUM(*s) || *s==':') ++s;