diff options
Diffstat (limited to 'src/regex.c')
| -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 09776848220..2eca58c23e8 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -2589,6 +2589,7 @@ regex_compile (pattern, size, syntax, bufp) | |||
| 2589 | bufp->syntax = syntax; | 2589 | bufp->syntax = syntax; |
| 2590 | bufp->fastmap_accurate = 0; | 2590 | bufp->fastmap_accurate = 0; |
| 2591 | bufp->not_bol = bufp->not_eol = 0; | 2591 | bufp->not_bol = bufp->not_eol = 0; |
| 2592 | bufp->used_syntax = 0; | ||
| 2592 | 2593 | ||
| 2593 | /* Set `used' to zero, so that if we return an error, the pattern | 2594 | /* Set `used' to zero, so that if we return an error, the pattern |
| 2594 | printer (for debugging) will think there's no pattern. We reset it | 2595 | printer (for debugging) will think there's no pattern. We reset it |
| @@ -3014,6 +3015,14 @@ regex_compile (pattern, size, syntax, bufp) | |||
| 3014 | } | 3015 | } |
| 3015 | } | 3016 | } |
| 3016 | 3017 | ||
| 3018 | /* In most cases the matching rule for char classes | ||
| 3019 | only uses the syntax table for multibyte chars, | ||
| 3020 | so that the content of the syntax-table it is not | ||
| 3021 | hardcoded in the range_table. SPACE and WORD are | ||
| 3022 | the two exceptions. */ | ||
| 3023 | if ((1 << cc) & ((1 << RECC_SPACE) | (1 << RECC_WORD))) | ||
| 3024 | bufp->used_syntax = 1; | ||
| 3025 | |||
| 3017 | /* Repeat the loop. */ | 3026 | /* Repeat the loop. */ |
| 3018 | continue; | 3027 | continue; |
| 3019 | } | 3028 | } |