diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-02-07 12:19:17 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-02-07 12:19:17 +0000 |
commit | a2b7337b02f836aab62591af0d79675c5d157499 (patch) | |
tree | c61fa2f9f19af6204bd963d72d2d5448b8bda68c /pp.c | |
parent | 7acbb8ec149b2b0481081c92fe4351d46ae0ae3a (diff) | |
download | perl-a2b7337b02f836aab62591af0d79675c5d157499.tar.gz |
Fix bug 38454 (rindex corrects for $[ on bytes rather than UTF-8)
p4raw-id: //depot/perl@27116
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -3239,9 +3239,13 @@ PP(pp_rindex) if (MAXARG < 3) offset = blen; else { + /* arybase is in characters, like offset, so combine prior to the + UTF-8 to bytes calculation. */ + offset -= arybase; if (offset > 0 && big_utf8) sv_pos_u2b(big, &offset, 0); - offset = offset - arybase + llen; + /* llen is in bytes. */ + offset += llen; } if (offset < 0) offset = 0; |