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>
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 451720a..5e4fadd 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -5666,12 +5666,7 @@
for (;;)
{
match = TRUE;
- // skip regstart
- len2 = MB_CHAR2LEN(regstart);
- if (enc_utf8 && len2 > 1 && MB_CHAR2LEN(PTR2CHAR(rex.line + col)) != len2)
- // because of case-folding of the previously matched text, we may need
- // to skip fewer bytes than mb_char2len(regstart)
- len2 = mb_char2len(utf_fold(regstart));
+ len2 = MB_CHAR2LEN(regstart); // skip regstart
for (len1 = 0; match_text[len1] != NUL; len1 += MB_CHAR2LEN(c1))
{
c1 = PTR2CHAR(match_text + len1);
@@ -7508,7 +7503,7 @@
// If match_text is set it contains the full text that must match.
// Nothing else to try. Doesn't handle combining chars well.
- if (prog->match_text != NULL && *prog->match_text != NUL && !rex.reg_icombine)
+ if (prog->match_text != NULL && !rex.reg_icombine)
{
retval = find_match_text(&col, prog->regstart, prog->match_text);
if (REG_MULTI)