diff options
author | KunMing Xie <qqzz014@gmail.com> | 2018-06-02 01:57:22 +0800 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-06-01 19:57:22 +0200 |
commit | 49a497a67c92f339ff9ce2939188b651e250367b (patch) | |
tree | 6774ff316bd501ba21169b59cc5dbd0759376964 /src/nvim/regexp_nfa.c | |
parent | c7350f542ade5ea4f19e490ef3638fbf8cf6db41 (diff) | |
download | rneovim-49a497a67c92f339ff9ce2939188b651e250367b.tar.gz rneovim-49a497a67c92f339ff9ce2939188b651e250367b.tar.bz2 rneovim-49a497a67c92f339ff9ce2939188b651e250367b.zip |
vim-patch:8.0.0519: character classes not well tested (#8460)
Problem: Character classes are not well tested. They can differ between
platforms.
Solution: Add tests. In the documentation make clear which classes depend
on what library function. Only use :cntrl: and :graph: for ASCII.
(Kazunobu Kuriyama, Dominique Pelle, closes vim/vim#1560)
Update the documentation.
https://github.com/vim/vim/commit/0c078fc7db2902d4ccba04506db082ddbef45a8c
Diffstat (limited to 'src/nvim/regexp_nfa.c')
-rw-r--r-- | src/nvim/regexp_nfa.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index 98fae858f6..0b8e979ca2 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -4358,16 +4358,18 @@ static int check_char_class(int class, int c) return OK; break; case NFA_CLASS_CNTRL: - if (c >= 1 && c <= 255 && iscntrl(c)) + if (c >= 1 && c <= 127 && iscntrl(c)) { return OK; + } break; case NFA_CLASS_DIGIT: if (ascii_isdigit(c)) return OK; break; case NFA_CLASS_GRAPH: - if (c >= 1 && c <= 255 && isgraph(c)) + if (c >= 1 && c <= 127 && isgraph(c)) { return OK; + } break; case NFA_CLASS_LOWER: if (mb_islower(c) && c != 170 && c != 186) { |