summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2021-08-05 15:24:59 +0200
committerBram Moolenaar <Bram@vim.org>2021-08-05 15:24:59 +0200
commitbc67e5a0a494f5fc48e872d747371e31a782d171 (patch)
tree5731c89feb894273875e3eeea212b5fc48f84e78 /src/search.c
parent4a01159da23a279005b7c5042a15af47eb9617fe (diff)
downloadvim-git-bc67e5a0a494f5fc48e872d747371e31a782d171.tar.gz
patch 8.2.3292: underscore in very magic pattern causes a hangv8.2.3292
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 #8707, closes #8704, closes #8705)
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/search.c b/src/search.c
index 43966511b..3b6b437c6 100644
--- a/src/search.c
+++ b/src/search.c
@@ -445,7 +445,7 @@ 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;
@@ -460,6 +460,8 @@ pat_has_uppercase(char_u *pat)
{
if (p[1] != NUL) // skip "_X" and %X
p += 2;
+ else
+ p++;
}
else if (MB_ISUPPER(*p))
return TRUE;