aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/regexp_nfa.c
diff options
context:
space:
mode:
authorMichael Ennen <mike.ennen@gmail.com>2016-12-21 01:57:59 -0700
committerMichael Ennen <mike.ennen@gmail.com>2016-12-31 14:38:27 -0700
commit415495273c1c53dbc28fae55b08f9672bc5414b0 (patch)
tree2a4c9aaab0e41b200d3c246a6c470bc7ed894a85 /src/nvim/regexp_nfa.c
parent5366242789a4c2f53c52d2fe2f6be7284fcc73b5 (diff)
downloadrneovim-415495273c1c53dbc28fae55b08f9672bc5414b0.tar.gz
rneovim-415495273c1c53dbc28fae55b08f9672bc5414b0.tar.bz2
rneovim-415495273c1c53dbc28fae55b08f9672bc5414b0.zip
vim-patch:7.4.1793
Problem: Some character classes may differ between systems. On OS/X the regexp test fails. Solution: Make this less dependent on the system. (idea by Kazunobu Kuriyama) https://github.com/vim/vim/commit/e8aee7dcf9b12becff86e8ce1783a86801c5f9f6
Diffstat (limited to 'src/nvim/regexp_nfa.c')
-rw-r--r--src/nvim/regexp_nfa.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c
index d96858632f..474f3df32a 100644
--- a/src/nvim/regexp_nfa.c
+++ b/src/nvim/regexp_nfa.c
@@ -4320,12 +4320,14 @@ static int check_char_class(int class, int c)
{
switch (class) {
case NFA_CLASS_ALNUM:
- if (c >= 1 && c <= 255 && isalnum(c))
+ if (c >= 1 && c < 128 && isalnum(c)) {
return OK;
+ }
break;
case NFA_CLASS_ALPHA:
- if (c >= 1 && c <= 255 && isalpha(c))
+ if (c >= 1 && c < 128 && isalpha(c)) {
return OK;
+ }
break;
case NFA_CLASS_BLANK:
if (c == ' ' || c == '\t')
@@ -4344,16 +4346,18 @@ static int check_char_class(int class, int c)
return OK;
break;
case NFA_CLASS_LOWER:
- if (vim_islower(c))
+ if (vim_islower(c) && c != 170 && c != 186) {
return OK;
+ }
break;
case NFA_CLASS_PRINT:
if (vim_isprintc(c))
return OK;
break;
case NFA_CLASS_PUNCT:
- if (c >= 1 && c <= 255 && ispunct(c))
+ if (c >= 1 && c < 128 && ispunct(c)) {
return OK;
+ }
break;
case NFA_CLASS_SPACE:
if ((c >= 9 && c <= 13) || (c == ' '))