mirror of
https://github.com/vim/vim.git
synced 2025-11-14 23:04:02 -05:00
patch 9.1.1700: Multiline ignorecase specific pattern does not match with 'ignorecase'
Problem: a pattern that involves a backref on a different line does not
match when 'ignorecase' is set (QiWei, after v9.1.0645)
Solution: Use MB_STRNICMP when ignorecase is set, fix tests to close
swapfiles
related: #14756
fixes: #17470
closes: #18104
Signed-off-by: author
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -1569,6 +1569,7 @@ reg_nextline(void)
|
||||
* Returns RA_FAIL, RA_NOMATCH or RA_MATCH.
|
||||
* If "bytelen" is not NULL, it is set to the byte length of the match in the
|
||||
* last line.
|
||||
* Optional: ignore case if rex.reg_ic is set.
|
||||
*/
|
||||
static int
|
||||
match_with_backref(
|
||||
@@ -1613,7 +1614,9 @@ match_with_backref(
|
||||
else
|
||||
len = (int)reg_getline_len(clnum) - ccol;
|
||||
|
||||
if (cstrncmp(p + ccol, rex.input, &len) != 0)
|
||||
// Use case-insensitive compare if rex.reg_ic is set
|
||||
if ((!rex.reg_ic && cstrncmp(p + ccol, rex.input, &len) != 0)
|
||||
|| (rex.reg_ic && MB_STRNICMP(p + ccol, rex.input, len) != 0))
|
||||
return RA_NOMATCH; // doesn't match
|
||||
if (bytelen != NULL)
|
||||
*bytelen += len;
|
||||
|
||||
Reference in New Issue
Block a user