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)

e8aee7dcf9
This commit is contained in:
Michael Ennen 2016-12-21 01:57:59 -07:00
parent 5366242789
commit 415495273c
3 changed files with 25 additions and 13 deletions

View File

@ -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++)

View File

@ -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 == ' '))

View File

@ -646,7 +646,7 @@ static int included_patches[] = {
// 1796 NA
// 1795 NA
// 1794 NA
// 1793,
1793,
// 1792 NA
// 1791 NA
// 1790 NA