If number of DFA states reaches at 1024, all transition tables are cleared in build_state() in order to avoid out-of-memory. However, for initial state that shouldn't be done, because it's always used. BTW, this patch enables to revert a previous patch "grep: do not count newline before the start of buffer", because no longer the code is never be run through at a first character of a text.