summaryrefslogtreecommitdiff
path: root/src/mbyte.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbyte.c')
-rw-r--r--src/mbyte.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mbyte.c b/src/mbyte.c
index 846ce98f7..735bf6544 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -2294,8 +2294,14 @@ mb_strnicmp(s1, s2, nn)
}
/* Check directly first, it's faster. */
for (j = 0; j < l; ++j)
+ {
if (s1[i + j] != s2[i + j])
break;
+ if (s1[i + j] == 0)
+ /* Both stings have the same bytes but are incomplete or
+ * have illegal bytes, accept them as equal. */
+ l = j;
+ }
if (j < l)
{
/* If one of the two characters is incomplete return -1. */