diff src/regexp.c @ 34857:3f8444c5a6f3 v9.1.0297

patch 9.1.0297: Patch 9.1.0296 causes too many issues Commit: https://github.com/vim/vim/commit/c97f4d61cde24030f2f7d2318e1b409a0ccc3e43 Author: Christian Brabandt <cb@256bit.org> Date: Wed Apr 10 16:18:15 2024 +0200 patch 9.1.0297: Patch 9.1.0296 causes too many issues Problem: Patch 9.1.0296 causes too many issues (Tony Mechelynck, @chdiza, CI) Solution: Back out the change for now Revert "patch 9.1.0296: regexp: engines do not handle case-folding well" This reverts commit 7a27c108e0509f3255ebdcb6558e896c223e4d23 it causes issues with syntax highlighting and breaks the FreeBSD and MacOS CI. It needs more work. fixes: #14487 Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Wed, 10 Apr 2024 16:30:06 +0200
parents 97b5457962ed
children 0b259135fb3a
line wrap: on
line diff
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -1606,9 +1606,7 @@ mb_decompose(int c, int *c1, int *c2, in
 /*
  * Compare two strings, ignore case if rex.reg_ic set.
  * Return 0 if strings match, non-zero otherwise.
- * Correct the length "*n" when composing characters are ignored
- * or for utf8 when both utf codepoints are considered equal because of
- * case-folding but have different length (e.g. 's' and 'ſ')
+ * Correct the length "*n" when composing characters are ignored.
  */
     static int
 cstrncmp(char_u *s1, char_u *s2, int *n)
@@ -1617,13 +1615,6 @@ cstrncmp(char_u *s1, char_u *s2, int *n)
 
     if (!rex.reg_ic)
 	result = STRNCMP(s1, s2, *n);
-    else if (enc_utf8)
-    {
-	int l2 = mb_ptr2len(s2);
-	result = MB_STRNICMP2(s1, s2, *n, l2);
-	if (result == 0 && l2 < *n)
-	    *n = l2;
-    }
     else
 	result = MB_STRNICMP(s1, s2, *n);