forked from aniani/vim
patch 8.0.0519: character classes are not well tested
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.
This commit is contained in:
@@ -4871,7 +4871,7 @@ 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:
|
||||
@@ -4879,7 +4879,7 @@ check_char_class(int class, int 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:
|
||||
|
Reference in New Issue
Block a user