test.pl-ify and add a couple of tests.
[p5sagit/p5-mst-13.2.git] / dump.c
diff --git a/dump.c b/dump.c
index 70c6ef0..61cd8e0 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -1,6 +1,7 @@
 /*    dump.c
  *
- *    Copyright (c) 1991-2003, Larry Wall
+ *    Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+ *    2000, 2001, 2002, 2003, by Larry Wall and others
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -615,6 +616,10 @@ Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, OP *o)
            if (o->op_private & OPpHUSH_VMSISH)
                sv_catpv(tmpsv, ",HUSH_VMSISH");
        }
+       else if (OP_IS_FILETEST_ACCESS(o)) {
+            if (o->op_private & OPpFT_ACCESS)
+                 sv_catpv(tmpsv, ",FT_ACCESS");
+       }
        if (o->op_flags & OPf_MOD && o->op_private & OPpLVAL_INTRO)
            sv_catpv(tmpsv, ",INTRO");
        if (SvCUR(tmpsv))
@@ -939,7 +944,7 @@ Perl_do_gvgv_dump(pTHX_ I32 level, PerlIO *file, char *name, GV *sv)
     Perl_dump_indent(aTHX_ level, file, "%s = 0x%"UVxf, name, PTR2UV(sv));
     if (sv && GvNAME(sv)) {
        PerlIO_printf(file, "\t\"");
-       if (GvSTASH(sv))
+       if (GvSTASH(sv) && HvNAME(GvSTASH(sv)))
            PerlIO_printf(file, "%s\" :: \"", HvNAME(GvSTASH(sv)));
        PerlIO_printf(file, "%s\"\n", GvNAME(sv));
     }
@@ -954,7 +959,6 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
     char *s;
     U32 flags;
     U32 type;
-    STRLEN n_a;
 
     if (!sv) {
        Perl_dump_indent(aTHX_ level, file, "SV = 0\n");
@@ -1180,8 +1184,9 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
        Perl_dump_indent(aTHX_ level, file, "  TARGOFF = %"IVdf"\n", (IV)LvTARGOFF(sv));
        Perl_dump_indent(aTHX_ level, file, "  TARGLEN = %"IVdf"\n", (IV)LvTARGLEN(sv));
        Perl_dump_indent(aTHX_ level, file, "  TARG = 0x%"UVxf"\n", PTR2UV(LvTARG(sv)));
-       /* XXX level+1 ??? */
-       do_sv_dump(level, file, LvTARG(sv), nest+1, maxnest, dumpops, pvlim);
+       if (LvTYPE(sv) != 't' && LvTYPE(sv) != 'T')
+           do_sv_dump(level+1, file, LvTARG(sv), nest+1, maxnest,
+                   dumpops, pvlim);
        break;
     case SVt_PVAV:
        Perl_dump_indent(aTHX_ level, file, "  ARRAY = 0x%"UVxf, PTR2UV(AvARRAY(sv)));