Subject: Empty lines when using color and searching through files with DOS newline

From: DrSlony <[email-masked]>
Date: Wed, 28 Feb 2018 12:06:45 +0100

Hello

Today I ran into this very old bug where grep returns empty lines when
grepping through files with DOS-style \r\n newlines.

To reproduce:
grep "foo.*" *.txt

Verify that it does in fact find things:
grep "popup.*" *.bas | od -c

This prints the lines correctly:
grep --color=never "foo.*" *.txt

I found a report of this issue at least from 2009:
http://savannah.gnu.org/bugs/?25539

I'm using GNU grep 3.1.

Kind regards
DrSlony