aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/regexp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r--src/nvim/regexp.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index 7e2fc261f2..4b5e17b00b 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -4573,12 +4573,14 @@ regmatch (
if (OP(next) == EXACTLY) {
rst.nextb = *OPERAND(next);
if (ireg_ic) {
- if (mb_isupper(rst.nextb))
+ if (mb_isupper(rst.nextb)) {
rst.nextb_ic = mb_tolower(rst.nextb);
- else
+ } else {
rst.nextb_ic = mb_toupper(rst.nextb);
- } else
+ }
+ } else {
rst.nextb_ic = rst.nextb;
+ }
} else {
rst.nextb = NUL;
rst.nextb_ic = NUL;
@@ -6312,14 +6314,15 @@ static char_u *cstrchr(char_u *s, int c)
/* tolower() and toupper() can be slow, comparing twice should be a lot
* faster (esp. when using MS Visual C++!).
* For UTF-8 need to use folded case. */
- if (enc_utf8 && c > 0x80)
+ if (c > 0x80) {
cc = utf_fold(c);
- else if (mb_isupper(c))
+ } else if (mb_isupper(c)) {
cc = mb_tolower(c);
- else if (mb_islower(c))
+ } else if (mb_islower(c)) {
cc = mb_toupper(c);
- else
+ } else {
return vim_strchr(s, c);
+ }
if (has_mbyte) {
for (p = s; *p != NUL; p += (*mb_ptr2len)(p)) {