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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]