From: Nicholas Clark Date: Sat, 6 Oct 2007 15:04:53 +0000 (+0000) Subject: Use the PERL_PV_PRETTY_NOCLEAR flag to simplify the code in X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f92a21223cc4e5d3eeba96e73da58d39e333b778;p=p5sagit%2Fp5-mst-13.2.git Use the PERL_PV_PRETTY_NOCLEAR flag to simplify the code in Perl_regprop() for the EXACT node case. p4raw-id: //depot/perl@32049 --- diff --git a/regcomp.c b/regcomp.c index 2af7958..d12f18b 100644 --- a/regcomp.c +++ b/regcomp.c @@ -8805,19 +8805,17 @@ Perl_regprop(pTHX_ const regexp *prog, SV *sv, const regnode *o) k = PL_regkind[OP(o)]; if (k == EXACT) { - SV * const dsv = sv_2mortal(newSVpvs("")); + sv_catpvs(sv, " "); /* Using is_utf8_string() (via PERL_PV_UNI_DETECT) * is a crude hack but it may be the best for now since * we have no flag "this EXACTish node was UTF-8" * --jhi */ - const char * const s = - pv_pretty(dsv, STRING(o), STR_LEN(o), 60, - PL_colors[0], PL_colors[1], - PERL_PV_ESCAPE_UNI_DETECT | - PERL_PV_PRETTY_ELLIPSES | - PERL_PV_PRETTY_LTGT - ); - Perl_sv_catpvf(aTHX_ sv, " %s", s ); + pv_pretty(sv, STRING(o), STR_LEN(o), 60, PL_colors[0], PL_colors[1], + PERL_PV_ESCAPE_UNI_DETECT | + PERL_PV_PRETTY_ELLIPSES | + PERL_PV_PRETTY_LTGT | + PERL_PV_PRETTY_NOCLEAR + ); } else if (k == TRIE) { /* print the details of the trie in dumpuntil instead, as * progi->data isn't available here */