diff options
Diffstat (limited to 'src/regex.c')
| -rw-r--r-- | src/regex.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/regex.c b/src/regex.c index 83d80b5aaa9..04429386f84 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -2622,7 +2622,7 @@ regex_compile (const re_char *pattern, size_t size, reg_syntax_t syntax, struct | |||
| 2622 | goto normal_char; | 2622 | goto normal_char; |
| 2623 | handle_plus: | 2623 | handle_plus: |
| 2624 | case '*': | 2624 | case '*': |
| 2625 | /* If there is no previous pattern... */ | 2625 | /* If there is no previous pattern... */ |
| 2626 | if (!laststart) | 2626 | if (!laststart) |
| 2627 | { | 2627 | { |
| 2628 | if (syntax & RE_CONTEXT_INVALID_OPS) | 2628 | if (syntax & RE_CONTEXT_INVALID_OPS) |
| @@ -2730,7 +2730,7 @@ regex_compile (const re_char *pattern, size_t size, reg_syntax_t syntax, struct | |||
| 2730 | } | 2730 | } |
| 2731 | } | 2731 | } |
| 2732 | else /* not greedy */ | 2732 | else /* not greedy */ |
| 2733 | { /* I wish the greedy and non-greedy cases could be merged. */ | 2733 | { /* I wish the greedy and non-greedy cases could be merged. */ |
| 2734 | 2734 | ||
| 2735 | GET_BUFFER_SPACE (7); /* We might use less. */ | 2735 | GET_BUFFER_SPACE (7); /* We might use less. */ |
| 2736 | if (many_times_ok) | 2736 | if (many_times_ok) |
| @@ -3034,7 +3034,7 @@ regex_compile (const re_char *pattern, size_t size, reg_syntax_t syntax, struct | |||
| 3034 | 3034 | ||
| 3035 | /* Allocate space for COUNT + RANGE_TABLE. Needs two | 3035 | /* Allocate space for COUNT + RANGE_TABLE. Needs two |
| 3036 | bytes for flags, two for COUNT, and three bytes for | 3036 | bytes for flags, two for COUNT, and three bytes for |
| 3037 | each character. */ | 3037 | each character. */ |
| 3038 | GET_BUFFER_SPACE (4 + used * 3); | 3038 | GET_BUFFER_SPACE (4 + used * 3); |
| 3039 | 3039 | ||
| 3040 | /* Indicate the existence of range table. */ | 3040 | /* Indicate the existence of range table. */ |
| @@ -3461,6 +3461,7 @@ regex_compile (const re_char *pattern, size_t size, reg_syntax_t syntax, struct | |||
| 3461 | /* There is no way to specify the before_dot and after_dot | 3461 | /* There is no way to specify the before_dot and after_dot |
| 3462 | operators. rms says this is ok. --karl */ | 3462 | operators. rms says this is ok. --karl */ |
| 3463 | case '=': | 3463 | case '=': |
| 3464 | laststart = b; | ||
| 3464 | BUF_PUSH (at_dot); | 3465 | BUF_PUSH (at_dot); |
| 3465 | break; | 3466 | break; |
| 3466 | 3467 | ||
| @@ -3509,12 +3510,14 @@ regex_compile (const re_char *pattern, size_t size, reg_syntax_t syntax, struct | |||
| 3509 | case '<': | 3510 | case '<': |
| 3510 | if (syntax & RE_NO_GNU_OPS) | 3511 | if (syntax & RE_NO_GNU_OPS) |
| 3511 | goto normal_char; | 3512 | goto normal_char; |
| 3513 | laststart = b; | ||
| 3512 | BUF_PUSH (wordbeg); | 3514 | BUF_PUSH (wordbeg); |
| 3513 | break; | 3515 | break; |
| 3514 | 3516 | ||
| 3515 | case '>': | 3517 | case '>': |
| 3516 | if (syntax & RE_NO_GNU_OPS) | 3518 | if (syntax & RE_NO_GNU_OPS) |
| 3517 | goto normal_char; | 3519 | goto normal_char; |
| 3520 | laststart = b; | ||
| 3518 | BUF_PUSH (wordend); | 3521 | BUF_PUSH (wordend); |
| 3519 | break; | 3522 | break; |
| 3520 | 3523 | ||