const U8 dq = (flags & PERL_PV_PRETTY_QUOTE) ? '"' : '%';
STRLEN escaped;
+ if (!(flags & PERL_PV_PRETTY_NOCLEAR)) {
+ /* This won't alter the UTF-8 flag */
+ sv_setpvn(dsv, "", 0);
+ }
+
if ( dq == '"' )
- sv_setpvn(dsv, "\"", 1);
+ sv_catpvn(dsv, "\"", 1);
else if ( flags & PERL_PV_PRETTY_LTGT )
- sv_setpvn(dsv, "<", 1);
- else
- sv_setpvn(dsv, "", 0);
+ sv_catpvn(dsv, "<", 1);
if ( start_color != NULL )
Perl_sv_catpv( aTHX_ dsv, start_color);
#define PERL_PV_ESCAPE_NOCLEAR 0x4000
#define PERL_PV_ESCAPE_RE 0x8000
+#define PERL_PV_PRETTY_NOCLEAR PERL_PV_ESCAPE_NOCLEAR
+
/* used by pv_display in dump.c*/
#define PERL_PV_PRETTY_DUMP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE
#define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE