summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-12-30 23:12:17 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-30 23:12:17 +0000
commit2ad154feab0e255cadacb1ad90bde4145e7d573e (patch)
tree19e19708ae633233d3c66cee883fe906f9d41c36 /utf8.c
parent2ddfca77c091e81a547f3b4f6325ece2309ec9f0 (diff)
downloadperl-2ad154feab0e255cadacb1ad90bde4145e7d573e.tar.gz
Four wrongs can make a right.
p4raw-id: //depot/perl@13965
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/utf8.c b/utf8.c
index 27f86b60c8..0453d1b763 100644
--- a/utf8.c
+++ b/utf8.c
@@ -1668,7 +1668,7 @@ Perl_ibcmp_utf8(pTHX_ const char *s1, bool u1, register I32 len1, const char *s2
{
register U8 *a = (U8*)s1;
register U8 *b = (U8*)s2;
- register U8 *ae = b + len1;
+ register U8 *ae = a + len1;
register U8 *be = b + len2;
STRLEN la, lb;
UV ca, cb;
@@ -1703,7 +1703,8 @@ Perl_ibcmp_utf8(pTHX_ const char *s1, bool u1, register I32 len1, const char *s2
else
ulen2 = 1;
if (ulen1 != ulen2
- || (ulen1 == 1 && PL_fold[ca] != PL_fold[cb])
+ || (ca < 256 && cb < 256 &&
+ PL_fold[ca] != PL_fold[cb])
|| memNE((char *)tmpbuf1, (char *)tmpbuf2, ulen1))
return 1; /* mismatch */
}