2003-06-04 Paolo Bonzini * posix/regexec.c (group_nodes_into_DFAstates): check for NEXT_ENDBUF_CONSTRAINT. Move check for constraints which do a `continue' before the others. --- regexec.c.old Wed Jun 4 10:12:18 2003 +++ regexec.c Wed Jun 4 10:25:21 2003 @@ -3263,25 +3263,30 @@ group_nodes_into_DFAstates (preg, state, /* Check the `accepts' and sift the characters which are not match it the context. */ if (constraint) { - if (constraint & NEXT_WORD_CONSTRAINT) - for (j = 0; j < BITSET_UINTS; ++j) - accepts[j] &= dfa->word_char[j]; - if (constraint & NEXT_NOTWORD_CONSTRAINT) - for (j = 0; j < BITSET_UINTS; ++j) - accepts[j] &= ~dfa->word_char[j]; if (constraint & NEXT_NEWLINE_CONSTRAINT) { int accepts_newline = bitset_contain (accepts, NEWLINE_CHAR); bitset_empty (accepts); if (accepts_newline) bitset_set (accepts, NEWLINE_CHAR); else continue; } + if (constraint & NEXT_ENDBUF_CONSTRAINT) + { + bitset_empty (accepts); + continue; + } + if (constraint & NEXT_WORD_CONSTRAINT) + for (j = 0; j < BITSET_UINTS; ++j) + accepts[j] &= dfa->word_char[j]; + if (constraint & NEXT_NOTWORD_CONSTRAINT) + for (j = 0; j < BITSET_UINTS; ++j) + accepts[j] &= ~dfa->word_char[j]; } /* Then divide `accepts' into DFA states, or create a new state. */ for (j = 0; j < ndests; ++j)