Small grep.c refactoring