summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2005-06-05 21:06:12 +0300
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-06-07 14:35:25 +0000
commit768c67ee6ae82fc2dd99a9dd06708f0a0cc097cb (patch)
tree2c7376ce53618bad206d31f088eae62bba0e59c2 /mg.c
parente07360faf0e39eb99a2f8007e291aab60c228731 (diff)
downloadperl-768c67ee6ae82fc2dd99a9dd06708f0a0cc097cb.tar.gz
one more round of is_utf8_foo tuneup
Message-ID: <42A314E4.8060608@gmail.com> p4raw-id: //depot/perl@24730
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mg.c b/mg.c
index 05b9fc67c0..7a5c1cfd9a 100644
--- a/mg.c
+++ b/mg.c
@@ -495,10 +495,12 @@ Perl_magic_len(pTHX_ SV *sv, MAGIC *mg)
if (i > 0 && RX_MATCH_UTF8(rx)) {
char *s = rx->subbeg + s1;
char *send = rx->subbeg + t1;
+ const U8 *ep;
+ STRLEN el;
i = t1 - s1;
- if (is_utf8_string((U8*)s, i))
- i = Perl_utf8_length(aTHX_ (U8*)s, (U8*)send);
+ if (is_utf8_string_loclen((U8*)s, i, &ep, &el))
+ i = el;
}
if (i < 0)
Perl_croak(aTHX_ "panic: magic_len: %"IVdf, (IV)i);