Thread (98 messages) flat view 98 messages, 5 authors, 2016-06-15

Re: [PATCH v2 16/17] grep: read -f file with strbuf_getline_crlf()

From: Johannes Schindelin <hidden>
Date: 2016-06-15 23:07:37

Possibly related (same subject, not in this thread)

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help