From unknown Tue Jun 17 20:17:30 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#30652 <30652@debbugs.gnu.org> To: bug#30652 <30652@debbugs.gnu.org> Subject: Status: Empty lines when using color and searching through files with DOS newline Reply-To: bug#30652 <30652@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:17:30 +0000 retitle 30652 Empty lines when using color and searching through files with= DOS newline reassign 30652 grep submitter 30652 DrSlony severity 30652 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 28 10:59:06 2018 Received: (at submit) by debbugs.gnu.org; 28 Feb 2018 15:59:06 +0000 Received: from localhost ([127.0.0.1]:37679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1er48H-0001bz-Ps for submit@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 ) id 1eqzZb-0000qK-F8 for submit@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 ) id 1eqzZV-0001Fe-G1 for submit@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 ) id 1eqzZV-0001FZ-CD for submit@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 ) id 1eqzZU-0007XD-2t for bug-grep@gnu.org; Wed, 28 Feb 2018 06:06:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqzZQ-0001DV-0N for bug-grep@gnu.org; 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 ) id 1eqzZP-0001D0-Ny for bug-grep@gnu.org; Wed, 28 Feb 2018 06:06:47 -0500 Received: by mail-lf0-x22f.google.com with SMTP id m69so2883518lfe.8 for ; 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 Date: Wed, 28 Feb 2018 12:06:45 +0100 Message-ID: Subject: Empty lines when using color and searching through files with DOS newline To: bug-grep@gnu.org 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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
Hello

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.

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=3Dnever "foo.*" *.txt

I found a report of this issue at least from 2009:<= /div>

I'm using=C2=A0GNU = grep 3.1.

Kind regards
DrSlony
--94eb2c1a073a27c508056643bdcd-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 01 02:33:50 2020 Received: (at control) by debbugs.gnu.org; 1 Jan 2020 07:33:50 +0000 Received: from localhost ([127.0.0.1]:35547 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1imYVq-00067w-3F for submit@debbugs.gnu.org; Wed, 01 Jan 2020 02:33:50 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:48066) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1imYVo-00067h-L1 for control@debbugs.gnu.org; Wed, 01 Jan 2020 02:33:49 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 34C2716008F for ; Tue, 31 Dec 2019 23:33:43 -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 p4aGBfdSKMxO for ; Tue, 31 Dec 2019 23:33:42 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 967A416022A for ; Tue, 31 Dec 2019 23:33:42 -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 t5geJI8hBx_q for ; Tue, 31 Dec 2019 23:33:42 -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 5162F16008F for ; Tue, 31 Dec 2019 23:33:42 -0800 (PST) To: control@debbugs.gnu.org From: Paul Eggert Subject: merge 30535 and 30652 Organization: UCLA Computer Science Department Message-ID: <6cc07761-8f79-b4b7-40cb-b3d0497e504c@cs.ucla.edu> Date: Tue, 31 Dec 2019 23:33:42 -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: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) severity 30652 wishlist tags 30535 - notabug merge 30652 30535 From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 01 02:34:24 2020 Received: (at 30652) by debbugs.gnu.org; 1 Jan 2020 07:34:24 +0000 Received: from localhost ([127.0.0.1]:35552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1imYWO-00069L-DX for submit@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 ) id 1imYWM-000694-QM for 30652@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 From: Paul Eggert 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@cs.ucla.edu> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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 so I have merged the two bug reports (Bug#30535 and Bug#30652).