GNU bug report logs - #30652
Empty lines when using color and searching through files with DOS newline

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: grep; Severity: wishlist; Reported by: DrSlony <entertheyoni@HIDDEN>; merged with #30535; dated Wed, 28 Feb 2018 16:00:04 UTC; Maintainer for grep is bug-grep@HIDDEN.

Message received at 30652 <at> debbugs.gnu.org:


Received: (at 30652) by debbugs.gnu.org; 1 Jan 2020 07:34:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 01 02:34:24 2020
Received: from localhost ([127.0.0.1]:35552 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1imYWO-00069L-DX
	for submit <at> debbugs.gnu.org; Wed, 01 Jan 2020 02:34:24 -0500
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:48150)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1imYWM-000694-QM
 for 30652 <at> debbugs.gnu.org; Wed, 01 Jan 2020 02:34:23 -0500
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 75FD616008F;
 Tue, 31 Dec 2019 23:34:17 -0800 (PST)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id q8PsNVUk7dBF; Tue, 31 Dec 2019 23:34:16 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id A930116022A;
 Tue, 31 Dec 2019 23:34:16 -0800 (PST)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id Vj9oY70-fCom; Tue, 31 Dec 2019 23:34:16 -0800 (PST)
Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com
 [23.242.74.103])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 829F516008F;
 Tue, 31 Dec 2019 23:34:16 -0800 (PST)
To: DrSlony <entertheyoni@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Subject: Re: Empty lines when using color and searching through files with DOS
 newline
Organization: UCLA Computer Science Department
Message-ID: <915f39f0-0e40-2329-8f08-46cf8f768e9f@HIDDEN>
Date: Tue, 31 Dec 2019 23:34:16 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
 Thunderbird/68.2.2
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 30652
Cc: 30652 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

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

This appears to be the same as Bug#30535 <https://bugs.gnu.org/30535> so I have
merged the two bug reports (Bug#30535 and Bug#30652).




Information forwarded to bug-grep@HIDDEN:
bug#30652; Package grep. Full text available.
Merged 30535 30652. Request was from Paul Eggert <eggert@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Paul Eggert <eggert@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Feb 2018 15:59:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 28 10:59:06 2018
Received: from localhost ([127.0.0.1]:37679 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1er48H-0001bz-Ps
	for submit <at> debbugs.gnu.org; Wed, 28 Feb 2018 10:59:06 -0500
Received: from eggs.gnu.org ([208.118.235.92]:50349)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <entertheyoni@HIDDEN>) id 1eqzZb-0000qK-F8
 for submit <at> debbugs.gnu.org; Wed, 28 Feb 2018 06:07:00 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <entertheyoni@HIDDEN>) id 1eqzZV-0001Fe-G1
 for submit <at> debbugs.gnu.org; Wed, 28 Feb 2018 06:06:54 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM,
 HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:36936)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <entertheyoni@HIDDEN>)
 id 1eqzZV-0001FZ-CD
 for submit <at> debbugs.gnu.org; Wed, 28 Feb 2018 06:06:53 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:41315)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <entertheyoni@HIDDEN>) id 1eqzZU-0007XD-2t
 for bug-grep@HIDDEN; Wed, 28 Feb 2018 06:06:53 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <entertheyoni@HIDDEN>) id 1eqzZQ-0001DV-0N
 for bug-grep@HIDDEN; Wed, 28 Feb 2018 06:06:52 -0500
Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]:41705)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <entertheyoni@HIDDEN>)
 id 1eqzZP-0001D0-Ny
 for bug-grep@HIDDEN; Wed, 28 Feb 2018 06:06:47 -0500
Received: by mail-lf0-x22f.google.com with SMTP id m69so2883518lfe.8
 for <bug-grep@HIDDEN>; Wed, 28 Feb 2018 03:06:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:from:date:message-id:subject:to;
 bh=TovhUoHTNOXw26jx/pmCfF6BQEWYugs+LNO7xMUl3tY=;
 b=OpuZO4E2F6yqsAKRRWVYlWgvitnIH54ktjg2ZB6909XdDwIJz8UHJClQcSHP0L66Ow
 syxTa6f+MMCKoENBbL/sRLEh/CSgvgM56sgWC2+W28t7wrirXjrTe7l+Rb73y7+Vc9xN
 RzqKTPqkT7SjQR7PTbbAxjtapKI4PEcg88AlxYZIjrzFFoHiT2K3iF419y2b6JrWJXAP
 BT9knZ1etQcVyTulFFZ9gkHZEB+bgOcN0ehFqKn4+ZZDw/LpSCQPSJD5JA04nNEXrAUV
 h7Loq/vrWOqQBaoUplJwYG21Tu4WZvFYCQBFfzbbdvIljsf+yFrBSI3jFgpaUmlQ/qx+
 GA/g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=TovhUoHTNOXw26jx/pmCfF6BQEWYugs+LNO7xMUl3tY=;
 b=I5DmKE9rD81Z1lgiQTlBcyqjan6c0J06Zts509+8E6L21TfdGTMpHT1Pf7kXzvxuIk
 KDh2EVBQAipgKYndDH8u/I6pAWWysvN1Bdj6RGNteZ+Ilph2IDr1L7Q99OtX3/XU+g/A
 MLMYyS/KxD0vjbgMRwdW9xltDVzD99sIJt0zP7V6PchGm9m7CJVHUiPvhkyiau5wKMOW
 yECpMLmiE1l44ky7K1U6D2MeY5jYJ3eFi7kv7iF6sToEpppvPSNWZaJ9H8wFhix2iOnX
 gYiSJC1lBROa3OpHKKyo2+sgbG6sjIKYARpDV2ni6lXM464aGHqQ3OYSQBZmu1nz75V4
 29Mw==
X-Gm-Message-State: APf1xPC+61ZiHu6yVIsMddaTYsW5F8SCUCfrzDpPcDY2g8G3+TzFIU0M
 hGgH1JdA0MagI9GE75bsxv/VTmCIU2psRFfsesqkxw==
X-Google-Smtp-Source: AG47ELvdREBUYNK2G2APBV/8xA/nOIC2DU8dYb5JMhJFG6HuNBRP9g6oMUSSOd2OFlYnk9uqRLSwxa8gOkXSRzIUsQ4=
X-Received: by 10.25.198.23 with SMTP id w23mr12334337lff.40.1519816005892;
 Wed, 28 Feb 2018 03:06:45 -0800 (PST)
MIME-Version: 1.0
Received: by 10.46.34.3 with HTTP; Wed, 28 Feb 2018 03:06:45 -0800 (PST)
From: DrSlony <entertheyoni@HIDDEN>
Date: Wed, 28 Feb 2018 12:06:45 +0100
Message-ID: <CAGW-2h0yK1mcimiXLVUbo2BXV8c6keqgHz8bUu1=KFou7_J+Lg@HIDDEN>
Subject: Empty lines when using color and searching through files with DOS
 newline
To: bug-grep@HIDDEN
Content-Type: multipart/alternative; boundary="94eb2c1a073a27c508056643bdcd"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Wed, 28 Feb 2018 10:59:04 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

--94eb2c1a073a27c508056643bdcd
Content-Type: text/plain; charset="UTF-8"

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

--94eb2c1a073a27c508056643bdcd
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hello<div><br></div><div>Today I ran into this very old bu=
g where grep returns empty lines when grepping through files with DOS-style=
=C2=A0\r\n newlines.</div><div><br></div><div>To reproduce:</div><div><font=
 face=3D"monospace, monospace">grep &quot;foo.*&quot; *.txt</font></div><di=
v><br></div><div><span style=3D"color:rgb(34,34,34);font-family:arial,sans-=
serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-=
variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;=
text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;bac=
kground-color:rgb(255,255,255);text-decoration-style:initial;text-decoratio=
n-color:initial;float:none;display:inline">Verify that it does in fact find=
 things:</span><br></div><div><span style=3D"color:rgb(34,34,34);font-famil=
y:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures=
:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text=
-align:start;text-indent:0px;text-transform:none;white-space:normal;word-sp=
acing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;t=
ext-decoration-color:initial;float:none;display:inline"><span style=3D"font=
-family:monospace"><span style=3D"color:rgb(0,0,0);background-color:rgb(255=
,255,255)">grep &quot;popup.*&quot; *.bas | od -c</span><br></span><br></sp=
an></div><div>This prints the lines correctly:<br></div><div><font face=3D"=
monospace, monospace">grep --color=3Dnever &quot;foo.*&quot; *.txt</font></=
div><div><br></div><div>I found a report of this issue at least from 2009:<=
/div><div><a href=3D"http://savannah.gnu.org/bugs/?25539">http://savannah.g=
nu.org/bugs/?25539</a><br></div><div><br></div><div>I&#39;m using=C2=A0GNU =
grep 3.1.</div><div><br></div><div>Kind regards</div><div>DrSlony</div></di=
v>

--94eb2c1a073a27c508056643bdcd--




Acknowledgement sent to DrSlony <entertheyoni@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-grep@HIDDEN. Full text available.
Report forwarded to bug-grep@HIDDEN:
bug#30652; Package grep. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 1 Jan 2020 07:45:02 UTC

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