summaryrefslogtreecommitdiffstats
path: root/src/macros.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-06-09 19:34:54 +0200
committerBram Moolenaar <Bram@vim.org>2020-06-09 19:34:54 +0200
commit59de417b904bbd204e313f015839317b577bd124 (patch)
tree4ebd73ce6e4ccd65b8a595f388c4535d81387319 /src/macros.h
parentdcf59c37d0e1517439c4c0c4a6a5ca09c90157ad (diff)
patch 8.2.0938: NFA regexp uses tolower ()to compare ignore-casev8.2.0938
Problem: NFA regexp uses tolower() to compare ignore-case. (Thayne McCombs) Solution: Use utf_fold() when possible. (ref. neovim #12456)
Diffstat (limited to 'src/macros.h')
-rw-r--r--src/macros.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/macros.h b/src/macros.h
index 16421d2615..7604910a6d 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -93,6 +93,7 @@
#define MB_ISUPPER(c) vim_isupper(c)
#define MB_TOLOWER(c) vim_tolower(c)
#define MB_TOUPPER(c) vim_toupper(c)
+#define MB_CASEFOLD(c) (enc_utf8 ? utf_fold(c) : MB_TOLOWER(c))
// Use our own isdigit() replacement, because on MS-Windows isdigit() returns
// non-zero for superscript 1. Also avoids that isdigit() crashes for numbers