From: Jarkko Hietaniemi Date: Sat, 31 May 2003 17:37:36 +0000 (+0000) Subject: Better patch from Inaba Hiroto for X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0aeb64d0d71d7345dba69c9999c49f4fbb55b24b;p=p5sagit%2Fp5-mst-13.2.git Better patch from Inaba Hiroto for [perl #22375] 'split'/'index' problem for utf8 p4raw-id: //depot/perl@19648 --- diff --git a/sv.c b/sv.c index d6ae16c..d7487ee 100644 --- a/sv.c +++ b/sv.c @@ -5947,12 +5947,16 @@ Perl_sv_pos_b2u(pTHX_ register SV* sv, I32* offsetp) while (backw--) { p--; - while (UTF8_IS_CONTINUATION(*p)) + while (UTF8_IS_CONTINUATION(*p)) { p--; + backw--; + } ubackw++; } cache[0] -= ubackw; + *offsetp = cache[0]; + return; } } }