Re: [PATCH v2 16/17] grep: read -f file with strbuf_getline_crlf()
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 4, 2016, 12:27 UTC
- Message-ID
- <alpine.DEB.2.20.1601041321360.14434@virtualbox>
- In-Reply-To
- <1450303398-25900-17-git-send-email-gitster@pobox.com>
Hi Junio,
On Wed, 16 Dec 2015, Junio C Hamano wrote:
> This is iffy; you may actually be trying to find a line with ^M in > it on a system whose line ending is LF. You can of course work it > around by having a line that has "^M^M^J", let the strbuf_getline_crlf() eat > the last "^M^J", leaving just the single "^M" as the pattern.
Thanks for being careful.
Having said that, `grep` operates on lines of text, and CR is established as a non-text byte, so I would argue that the previous behavior was actually incorrect: if you searched for, say, `abc$` in a CR/LF delimited file, the outcome would not have met my expectation of correct behavior.
Ciao, Dscho