GNU bug report logs - #32838
Regression in grep 3.1: Grep '$' matcher no longer works on CRLF files on Windows

Previous Next

Package: grep;

Reported by: Konstantin Kolinko <knst.kolinko <at> gmail.com>

Date: Tue, 25 Sep 2018 15:16:02 UTC

Severity: wishlist

Merged with 33162

To reply to this bug, email your comments to 32838 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#32838; Package grep. (Tue, 25 Sep 2018 15:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Konstantin Kolinko <knst.kolinko <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Tue, 25 Sep 2018 15:16:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Konstantin Kolinko <knst.kolinko <at> gmail.com>
To: bug-grep <at> gnu.org
Subject: Regression in grep 3.1: Grep '$' matcher no longer works on CRLF
 files on Windows
Date: Tue, 25 Sep 2018 11:15:51 +0300
Hi!

This issue has been reported downstream at Git for Windows project, here:
https://github.com/git-for-windows/git/issues/1841

Git for Windows includes a set of GNU utilities. IIRC those come from
MinGW project.

Summarizing from the downstream report:
Actual output, with grep 3.1 (in Git for Windows 2.19.0):
[[[
$ grep --version
grep (GNU grep) 3.1
...

$ cat > foo.txt
foo:
bar
baz:

$ unix2dos foo.txt
unix2dos: converting file foo.txt to DOS format...

$ grep ':$' < foo.txt

$ grep --line-regexp '.*:' foo.txt

$ grep --line-regexp '.*:' < foo.txt

]]]

Expected output, observable with grep 3.0 (in Git for Windows 2.18.0),
or if I run dos2unix on the file:

[[[
$ cp foo.txt foo2.txt

$ dos2unix foo2.txt
dos2unix: converting file foo2.txt to Unix format...

$ grep ':$' < foo2.txt
foo:
baz:

$ grep --line-regexp '.*:' foo2.txt
foo:
baz:

$ grep --line-regexp '.*:' < foo2.txt
foo:
baz:

]]]

I guess that this regression is related to the following changes
listed in the NEWS file, apparently implemented via #25707:

[[[
  The following changes affect only MS-Windows platforms.  First, the
  --binary (-U) option now governs whether binary I/O is used, instead
  of a heuristic that was sometimes incorrect.  Second, the
  --unix-byte-offsets (-u) option now has no effect on MS-Windows too.
]]]

Best regards,
Konstantin Kolinko




Merged 32838 33162. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Thu, 02 Jan 2020 01:13:02 GMT) Full text and rfc822 format available.

Severity set to 'wishlist' from 'normal' Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Mon, 21 Sep 2020 22:39:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-grep <at> gnu.org:
bug#32838; Package grep. (Mon, 21 Sep 2020 22:42:01 GMT) Full text and rfc822 format available.

Message #12 received at 32838 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Konstantin Kolinko <knst.kolinko <at> gmail.com>, Holger Klene <h.klene <at> gmx.de>
Cc: 33162 <at> debbugs.gnu.org, 32838 <at> debbugs.gnu.org
Subject: Re: bug#32838: Regression in grep 3.1: Grep '$' matcher no longer
 works on CRLF files on Windows
Date: Mon, 21 Sep 2020 15:41:23 -0700
On 9/25/18 1:15 AM, Konstantin Kolinko wrote:

> https://github.com/git-for-windows/git/issues/1841
Looking at that downstream bug report, it appears that this is a wishlist 
request and that there have been no takers for implementing an 
MS-Windows-specific --strip-trailing-cr option. I have marked Bug#32838 and 
Bug#33162 as wishlist in the grep bug database.




This bug report was last modified 4 years and 267 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.