aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/regex.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/regex.c b/src/regex.c
index e71961594ba..532d75330dc 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -3324,6 +3324,10 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
3324 unsigned char *p = bufp->buffer; 3324 unsigned char *p = bufp->buffer;
3325 register unsigned char *pend = p + bufp->used; 3325 register unsigned char *pend = p + bufp->used;
3326 3326
3327 /* Mark the opcode just after a start_memory, so we can test for an
3328 empty subpattern when we get to the stop_memory. */
3329 unsigned char *just_past_start_mem = 0;
3330
3327 /* We use this to map every character in the string. */ 3331 /* We use this to map every character in the string. */
3328 char *translate = bufp->translate; 3332 char *translate = bufp->translate;
3329 3333
@@ -3804,6 +3808,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
3804 3808
3805 /* Move past the register number and inner group count. */ 3809 /* Move past the register number and inner group count. */
3806 p += 2; 3810 p += 2;
3811 just_past_start_mem = p;
3807 break; 3812 break;
3808 3813
3809 3814
@@ -3868,7 +3873,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
3868 information for this group that we had before trying this 3873 information for this group that we had before trying this
3869 last match. */ 3874 last match. */
3870 if ((!MATCHED_SOMETHING (reg_info[*p]) 3875 if ((!MATCHED_SOMETHING (reg_info[*p])
3871 || (re_opcode_t) p[-3] == start_memory) 3876 || just_past_start_mem == p - 1)
3872 && (p + 2) < pend) 3877 && (p + 2) < pend)
3873 { 3878 {
3874 boolean is_a_jump_n = false; 3879 boolean is_a_jump_n = false;