diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/regex.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/regex.c b/src/regex.c index 66e363e731c..ae80ad0cee8 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -2530,6 +2530,7 @@ regex_compile (pattern, size, syntax, bufp) | |||
| 2530 | bufp->syntax = syntax; | 2530 | bufp->syntax = syntax; |
| 2531 | bufp->fastmap_accurate = 0; | 2531 | bufp->fastmap_accurate = 0; |
| 2532 | bufp->not_bol = bufp->not_eol = 0; | 2532 | bufp->not_bol = bufp->not_eol = 0; |
| 2533 | bufp->used_syntax = 0; | ||
| 2533 | 2534 | ||
| 2534 | /* Set `used' to zero, so that if we return an error, the pattern | 2535 | /* Set `used' to zero, so that if we return an error, the pattern |
| 2535 | printer (for debugging) will think there's no pattern. We reset it | 2536 | printer (for debugging) will think there's no pattern. We reset it |
| @@ -2942,6 +2943,14 @@ regex_compile (pattern, size, syntax, bufp) | |||
| 2942 | SET_LIST_BIT (translated); | 2943 | SET_LIST_BIT (translated); |
| 2943 | } | 2944 | } |
| 2944 | 2945 | ||
| 2946 | /* In most cases the matching rule for char classes | ||
| 2947 | only uses the syntax table for multibyte chars, | ||
| 2948 | so that the content of the syntax-table it is not | ||
| 2949 | hardcoded in the range_table. SPACE and WORD are | ||
| 2950 | the two exceptions. */ | ||
| 2951 | if ((1 << cc) & ((1 << RECC_SPACE) | (1 << RECC_WORD))) | ||
| 2952 | bufp->used_syntax = 1; | ||
| 2953 | |||
| 2945 | /* Repeat the loop. */ | 2954 | /* Repeat the loop. */ |
| 2946 | continue; | 2955 | continue; |
| 2947 | } | 2956 | } |