On Fri, 3 Jul 2015 20:10:08 -0700 Jim Meyering wrote: > Oh, nice! I see that Paul Eggert has just fixed this with > the following patch: > http://git.sv.gnu.org/cgit/grep.git/commit/?id=0e8fda0d880cccd0 > > So I'm closing this ticket. > Paul's fix is very nice, I could not found it. However, following case is not fixed yet. Not only '.' but also hat list (e.g. [^a]) should match newline with -z. So we need clear RE_HAT_LISTS_NOT_NEWLINE bit. $ seq 2 | LC_ALL=C grep --null-data '[1-2][^a][1-2]' 1 2 $ seq 2 | LC_ALL=en_US.iso88591 grep --null-data '[1-2][^a][1-2]'