add verbose stack display option, -Dvs
[p5sagit/p5-mst-13.2.git] / regcomp.c
index 6b17be1..cc283a6 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -4224,11 +4224,11 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state)
        SV *rv;
 
        /* The 0th element stores the character class description
-        * in its textual form: used later (regexec.c:Perl_regclass_swatch())
+        * in its textual form: used later (regexec.c:Perl_regclass_swash())
         * to initialize the appropriate swash (which gets stored in
         * the 1st element), and also useful for dumping the regnode.
         * The 2nd element stores the multicharacter foldings,
-        * used later (regexec.c:s_reginclasslen()). */
+        * used later (regexec.c:S_reginclass()). */
        av_store(av, 0, listsv);
        av_store(av, 1, NULL);
        av_store(av, 2, (SV*)unicode_alternate);
@@ -4882,9 +4882,13 @@ Perl_pregfree(pTHX_ struct regexp *r)
     if (!r || (--r->refcnt > 0))
        return;
     DEBUG_r({
-         char *s = pv_uni_display(dsv, (U8*)r->precomp, r->prelen, 60,
-                                 UNI_DISPLAY_REGEX);
-        int len = SvCUR(dsv);
+        int len;
+         char *s;
+
+        s = (r->reganch & ROPT_UTF8) ? pv_uni_display(dsv, (U8*)r->precomp,
+               r->prelen, 60, UNI_DISPLAY_REGEX)
+            : pv_display(dsv, r->precomp, r->prelen, 0, 60);
+        len = SvCUR(dsv);
         if (!PL_colorset)
              reginitcolors();
         PerlIO_printf(Perl_debug_log,