diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2004-03-28 13:11:30 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2004-03-28 13:11:30 +0000 |
commit | 46316b0a1e18bbab306c955d1ad4c7942f675812 (patch) | |
tree | ec8fbca72cccb1d1b43b4d2ab5017d25d9873db0 /dump.c | |
parent | cf2dc985c417547affbfd5f503520532b4626f60 (diff) | |
download | perl-46316b0a1e18bbab306c955d1ad4c7942f675812.tar.gz |
pv_display() had code to display \n etc as escapes but it didn't
actually work.
p4raw-id: //depot/perl@22605
Diffstat (limited to 'dump.c')
-rw-r--r-- | dump.c | 24 |
1 files changed, 11 insertions, 13 deletions
@@ -118,19 +118,17 @@ Perl_pv_display(pTHX_ SV *dsv, char *pv, STRLEN cur, STRLEN len, STRLEN pvlim) truncated++; break; } - if (isPRINT(*pv)) { - switch (*pv) { - case '\t': sv_catpvn(dsv, "\\t", 2); break; - case '\n': sv_catpvn(dsv, "\\n", 2); break; - case '\r': sv_catpvn(dsv, "\\r", 2); break; - case '\f': sv_catpvn(dsv, "\\f", 2); break; - case '"': sv_catpvn(dsv, "\\\"", 2); break; - case '\\': sv_catpvn(dsv, "\\\\", 2); break; - default: sv_catpvn(dsv, pv, 1); break; - } - } - else { - if (cur && isDIGIT(*(pv+1))) + switch (*pv) { + case '\t': sv_catpvn(dsv, "\\t", 2); break; + case '\n': sv_catpvn(dsv, "\\n", 2); break; + case '\r': sv_catpvn(dsv, "\\r", 2); break; + case '\f': sv_catpvn(dsv, "\\f", 2); break; + case '"': sv_catpvn(dsv, "\\\"", 2); break; + case '\\': sv_catpvn(dsv, "\\\\", 2); break; + default: + if (isPRINT(*pv)) + sv_catpvn(dsv, pv, 1); + else if (cur && isDIGIT(*(pv+1))) Perl_sv_catpvf(aTHX_ dsv, "\\%03o", (U8)*pv); else Perl_sv_catpvf(aTHX_ dsv, "\\%o", (U8)*pv); |