From: Dave Mitchell Date: Fri, 20 Oct 2006 10:06:57 +0000 (+0000) Subject: zero length $1 took too long to detect utf8-ness X-Git-Tag: accepted/trunk/20130322.191538~16820 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4978b1831a24ff36fc8bea075526005cdf40e132;p=platform%2Fupstream%2Fperl.git zero length $1 took too long to detect utf8-ness p4raw-id: //depot/perl@29059 --- diff --git a/mg.c b/mg.c index b477386..3ab49c0 100644 --- a/mg.c +++ b/mg.c @@ -861,7 +861,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) TAINT_NOT; sv_setpvn(sv, s, i); PL_tainted = oldtainted; - if (RX_MATCH_UTF8(rx) && is_utf8_string((U8*)s, i)) + if (RX_MATCH_UTF8(rx) && (!i || is_utf8_string((U8*)s, i))) SvUTF8_on(sv); else SvUTF8_off(sv);