summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-10-05 23:03:14 +0000
committerNicholas Clark <nick@ccl4.org>2007-10-05 23:03:14 +0000
commita5849ce59200ae4eedc45d2d16a7d1a3b6fc0ee2 (patch)
tree98544b551ba1be3275fcf48f096abcdc99011920 /toke.c
parentcb421d5edd945a7b56ee0a400c6b91d3acf45381 (diff)
downloadperl-a5849ce59200ae4eedc45d2d16a7d1a3b6fc0ee2.tar.gz
In the MAD code, eliminate one Perl_sv_catpvf() and convert one
construction to *pvs. p4raw-id: //depot/perl@32039
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/toke.c b/toke.c
index 1747114dc6..2b47e13d7a 100644
--- a/toke.c
+++ b/toke.c
@@ -3381,8 +3381,10 @@ Perl_yylex(pTHX)
else
Perl_croak(aTHX_ "panic: yylex");
if (PL_madskills) {
- SV* const tmpsv = newSVpvs("");
- Perl_sv_catpvf(aTHX_ tmpsv, "\\%c", *s);
+ SV* const tmpsv = newSVpvs("\\ ");
+ /* replace the space with the character we want to escape
+ */
+ SvPVX(tmpsv)[1] = *s;
curmad('_', tmpsv);
}
PL_bufptr = s + 1;
@@ -10956,8 +10958,12 @@ S_scan_subst(pTHX_ char *start)
PL_sublex_info.super_bufend = PL_bufend;
PL_multi_end = 0;
pm->op_pmflags |= PMf_EVAL;
- while (es-- > 0)
- sv_catpv(repl, (const char *)(es ? "eval " : "do "));
+ while (es-- > 0) {
+ if (es)
+ sv_catpvs(repl, "eval ");
+ else
+ sv_catpvs(repl, "do ");
+ }
sv_catpvs(repl, "{");
sv_catsv(repl, PL_lex_repl);
if (strchr(SvPVX(PL_lex_repl), '#'))