Norihiro Tanaka wrote: > I rebased this patch, and added four fixes to it. Thanks. This patch seems like a real performance win for grep -i in the usual case, so I installed it into the master. If we run into performance problems in unusual cases I suppose we can look into them as they arise. In reviewing the patch I found one memory-access typo: > - if ((end = memchr(beg, eol, buflim - beg)) != NULL) > ... > + if ((end = memchr(next_beg, eol, buflim - beg)) != NULL) That last "beg" should be "next_beg". I merged the patch into the current master on Savannah (first attached file) and then applied a fixup patch (second attached file) that fixes this bug and makes some other minor related improvements, e.g., using memrchr rather than looking for eol by hand.