# HG changeset patch # User Jim Meyering # Date 760680070 0 # Node ID e9cd26c4e4ffd20edc193d98ca3afee4a85f7b7a # Parent 2f86788715e5722a104ab0d4f63d528a0cc4ebcc *** empty log message *** diff -r 2f86788715e5 -r e9cd26c4e4ff src/regex.c --- a/src/regex.c Tue Feb 08 03:47:10 1994 +0000 +++ b/src/regex.c Tue Feb 08 04:01:10 1994 +0000 @@ -3324,6 +3324,10 @@ unsigned char *p = bufp->buffer; register unsigned char *pend = p + bufp->used; + /* Mark the opcode just after a start_memory, so we can test for an + empty subpattern when we get to the stop_memory. */ + unsigned char *just_past_start_mem = 0; + /* We use this to map every character in the string. */ char *translate = bufp->translate; @@ -3804,6 +3808,7 @@ /* Move past the register number and inner group count. */ p += 2; + just_past_start_mem = p; break; @@ -3868,7 +3873,7 @@ information for this group that we had before trying this last match. */ if ((!MATCHED_SOMETHING (reg_info[*p]) - || (re_opcode_t) p[-3] == start_memory) + || just_past_start_mem == p - 1) && (p + 2) < pend) { boolean is_a_jump_n = false;