mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 23:06:14 +00:00
vim-patch:8.2.3292: underscore in very magic pattern causes a hang
Problem: Underscore in very magic pattern causes a hang. Pattern with \V
are case sensitive. (Yutao Yuan)
Solution: Adjust condition for magicness and advance pointer. (Christian
Brabandt, closes vim/vim#8707, closes vim/vim#8704, closes vim/vim#8705)
bc67e5a0a4
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -386,7 +386,7 @@ bool pat_has_uppercase(char_u *pat)
|
||||
return true;
|
||||
}
|
||||
p += l;
|
||||
} else if (*p == '\\' && magic_val == MAGIC_ON) {
|
||||
} else if (*p == '\\' && magic_val <= MAGIC_ON) {
|
||||
if (p[1] == '_' && p[2] != NUL) { // skip "\_X"
|
||||
p += 3;
|
||||
} else if (p[1] == '%' && p[2] != NUL) { // skip "\%X"
|
||||
@@ -399,6 +399,8 @@ bool pat_has_uppercase(char_u *pat)
|
||||
} else if ((*p == '%' || *p == '_') && magic_val == MAGIC_ALL) {
|
||||
if (p[1] != NUL) { // skip "_X" and %X
|
||||
p += 2;
|
||||
} else {
|
||||
p++;
|
||||
}
|
||||
} else if (mb_isupper(*p)) {
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user