This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Refactoring to Sv*_set() macros - patch #5
[perl5.git] / dump.c
diff --git a/dump.c b/dump.c
index 0cff00b..cc500e0 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -229,7 +229,7 @@ Perl_sv_peek(pTHX_ SV *sv)
     if (SvROK(sv)) {
        sv_catpv(t, "\\");
        if (SvCUR(t) + unref > 10) {
-           SvCUR(t) = unref + 3;
+           SvCUR_set(t, unref + 3);
            *SvEND(t) = '\0';
            sv_catpv(t, "...");
            goto finish;
@@ -1200,8 +1200,10 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
     if ((type != SVt_PVHV) && SvUTF8(sv))
         sv_catpv(d, "UTF8");
 
-    if (*(SvEND(d) - 1) == ',')
-       SvPVX(d)[--SvCUR(d)] = '\0';
+    if (*(SvEND(d) - 1) == ',') {
+        SvCUR_set(d, SvCUR(d) - 1);
+       SvPVX(d)[SvCUR(d)] = '\0';
+    }
     sv_catpv(d, ")");
     s = SvPVX(d);