-Dr and unicode
Hugo van der Sanden [Mon, 1 Jul 2002 13:28:05 +0000 (14:28 +0100)]
Message-Id: <200207011228.g61CS5r06772@crypt.compulink.co.uk>

p4raw-id: //depot/perl@17391

regcomp.c

index 6b17be1..7b9f53f 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -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, (U8*)r->precomp, r->prelen, 0, 60);
+        len = SvCUR(dsv);
         if (!PL_colorset)
              reginitcolors();
         PerlIO_printf(Perl_debug_log,