summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2006-10-20 10:06:57 +0000
committerDave Mitchell <davem@fdisolutions.com>2006-10-20 10:06:57 +0000
commit4978b1831a24ff36fc8bea075526005cdf40e132 (patch)
tree37c9c1e7504a3fbe2395fdfb3f7123f416defb26 /mg.c
parent664e119dc7d588fadda4e2290471766a53190667 (diff)
downloadperl-4978b1831a24ff36fc8bea075526005cdf40e132.tar.gz
zero length $1 took too long to detect utf8-ness
p4raw-id: //depot/perl@29059
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mg.c b/mg.c
index b4773869e5..3ab49c0105 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);