From 415495273c1c53dbc28fae55b08f9672bc5414b0 Mon Sep 17 00:00:00 2001 From: Michael Ennen Date: Wed, 21 Dec 2016 01:57:59 -0700 Subject: 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 --- src/nvim/regexp.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src/nvim/regexp.c') diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 64a70c295a..122b589d2f 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -2309,14 +2309,18 @@ collection: } break; case CLASS_ALNUM: - for (cu = 1; cu <= 255; cu++) - if (isalnum(cu)) + for (cu = 1; cu < 128; cu++) { + if (isalnum(cu)) { regc(cu); + } + } break; case CLASS_ALPHA: - for (cu = 1; cu <= 255; cu++) - if (isalpha(cu)) + for (cu = 1; cu < 128; cu++) { + if (isalpha(cu)) { regc(cu); + } + } break; case CLASS_BLANK: regc(' '); @@ -2338,9 +2342,11 @@ collection: regc(cu); break; case CLASS_LOWER: - for (cu = 1; cu <= 255; cu++) - if (vim_islower(cu)) + for (cu = 1; cu <= 255; cu++) { + if (vim_islower(cu) && cu != 170 && cu != 186) { regc(cu); + } + } break; case CLASS_PRINT: for (cu = 1; cu <= 255; cu++) @@ -2348,9 +2354,11 @@ collection: regc(cu); break; case CLASS_PUNCT: - for (cu = 1; cu <= 255; cu++) - if (ispunct(cu)) + for (cu = 1; cu < 128; cu++) { + if (ispunct(cu)) { regc(cu); + } + } break; case CLASS_SPACE: for (cu = 9; cu <= 13; cu++) -- cgit