summaryrefslogtreecommitdiffstats
path: root/src/regexp.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-03-29 15:31:20 +0200
committerBram Moolenaar <Bram@vim.org>2017-03-29 15:31:20 +0200
commit0c078fc7db2902d4ccba04506db082ddbef45a8c (patch)
tree7c142af9692ea6315986e3d2239e8d3f143f6881 /src/regexp.c
parentc6cd8409c2993b1476e123fba11cb4b8d743b896 (diff)
patch 8.0.0519: character classes are not well testedv8.0.0519
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 #1560) Update the documentation.
Diffstat (limited to 'src/regexp.c')
-rw-r--r--src/regexp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/regexp.c b/src/regexp.c
index 91b8015bb8..b4fe7d7ebf 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -2555,17 +2555,17 @@ collection:
regc('\t');
break;
case CLASS_CNTRL:
- for (cu = 1; cu <= 255; cu++)
+ for (cu = 1; cu <= 127; cu++)
if (iscntrl(cu))
regmbc(cu);
break;
case CLASS_DIGIT:
- for (cu = 1; cu <= 255; cu++)
+ for (cu = 1; cu <= 127; cu++)
if (VIM_ISDIGIT(cu))
regmbc(cu);
break;
case CLASS_GRAPH:
- for (cu = 1; cu <= 255; cu++)
+ for (cu = 1; cu <= 127; cu++)
if (isgraph(cu))
regmbc(cu);
break;