aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mbyte.c
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2022-02-19 14:58:41 +0000
committerSean Dewar <seandewar@users.noreply.github.com>2022-02-19 15:29:17 +0000
commit9f4401897a860d10df9ce501eddbde725c943e44 (patch)
tree47487bbcf0dbbae1cca2a6c0e5dd5f8468a16910 /src/nvim/mbyte.c
parent30bf40ec4b44172d2720a6f2365cf6acb5ad8863 (diff)
downloadrneovim-9f4401897a860d10df9ce501eddbde725c943e44.tar.gz
rneovim-9f4401897a860d10df9ce501eddbde725c943e44.tar.bz2
rneovim-9f4401897a860d10df9ce501eddbde725c943e44.zip
vim-patch:8.2.4418: crash when using special multi-byte character
Problem: Crash when using special multi-byte character. Solution: Don't use isalpha() for an arbitrary character. https://github.com/vim/vim/commit/5921aeb5741fc6e84c870d68c7c35b93ad0c9f87 Rename vim_isalpha to mb_isalpha.
Diffstat (limited to 'src/nvim/mbyte.c')
-rw-r--r--src/nvim/mbyte.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index e5fa80a242..f634c7dda8 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -1317,6 +1317,12 @@ bool mb_isupper(int a)
return mb_tolower(a) != a;
}
+bool mb_isalpha(int a)
+ FUNC_ATTR_WARN_UNUSED_RESULT
+{
+ return mb_islower(a) || mb_isupper(a);
+}
+
static int utf_strnicmp(const char_u *s1, const char_u *s2, size_t n1, size_t n2)
{
int c1, c2, cdiff;