From unknown Tue Jun 24 10:31:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25693: -A and mixed line terminators Resent-From: Norbert de Jonge Original-Sender: "Debbugs-submit" Resent-CC: bug-grep@gnu.org Resent-Date: Sun, 12 Feb 2017 02:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25693 X-GNU-PR-Package: grep X-GNU-PR-Keywords: To: 25693@debbugs.gnu.org X-Debbugs-Original-To: bug-grep@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.14868656793550 (code B ref -1); Sun, 12 Feb 2017 02:15:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Feb 2017 02:14:39 +0000 Received: from localhost ([127.0.0.1]:36080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ccjgV-0000vC-6w for submit@debbugs.gnu.org; Sat, 11 Feb 2017 21:14:39 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60185) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ccjgS-0000uz-Uv for submit@debbugs.gnu.org; Sat, 11 Feb 2017 21:14:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ccjgM-0006ca-Nu for submit@debbugs.gnu.org; Sat, 11 Feb 2017 21:14:31 -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_40 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47249) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ccjgM-0006cU-Kb for submit@debbugs.gnu.org; Sat, 11 Feb 2017 21:14:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccjgL-0008Mn-Dn for bug-grep@gnu.org; Sat, 11 Feb 2017 21:14:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ccjgI-0006Zr-8Q for bug-grep@gnu.org; Sat, 11 Feb 2017 21:14:29 -0500 Received: from relay4.webreus.nl ([46.235.46.212]:39119) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccjgI-0006ZA-24 for bug-grep@gnu.org; Sat, 11 Feb 2017 21:14:26 -0500 Received: from srv253033.webreus.nl (srv045033.webreus.nl [46.235.45.33]) by relay4.webreus.nl (Postfix) with ESMTP id 1B80B17D700CB for ; Sun, 12 Feb 2017 03:14:22 +0100 (CET) Received: (qmail 26590 invoked from network); 12 Feb 2017 03:14:21 +0100 Received: from 77-173-90-33.ip.telfort.nl (HELO ren) (77.173.90.33) by srv045033.webreus.nl with (AES128-SHA encrypted) SMTP; 12 Feb 2017 03:14:21 +0100 Date: Sun, 12 Feb 2017 03:14:18 +0100 From: Norbert de Jonge Message-ID: <20170212031418.6e49bcfd@ren> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) 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: -5.0 (-----) Hi, I don't know if this is a bug or not, but -A does not seem to properly deal with mixed line terminators. Here's a way to replicate the issue. $ wget http://www.popot.org/popuw_forum_archive/4a.html $ file 4a.html $ wc -l 4a.html $ grep -A 10000 tul 4a.html $ tail 4a.html I'm requesting 10000 lines of trailing context, which is more lines than the entire file, but output is prematurely cut off. Best regards, Norbert From unknown Tue Jun 24 10:31:22 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Norbert de Jonge Subject: bug#25693: closed (Re: bug#25693: -A and mixed line terminators) Message-ID: References: <1dc054cd-ef7b-6186-5671-10f7b7fa6b17@cs.ucla.edu> <20170212031418.6e49bcfd@ren> X-Gnu-PR-Message: they-closed 25693 X-Gnu-PR-Package: grep Reply-To: 25693@debbugs.gnu.org Date: Sun, 12 Feb 2017 07:45:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1486885502-20648-1" This is a multi-part message in MIME format... ------------=_1486885502-20648-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #25693: -A and mixed line terminators which was filed against the grep package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 25693@debbugs.gnu.org. --=20 25693: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D25693 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1486885502-20648-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 25693-done) by debbugs.gnu.org; 12 Feb 2017 07:44:39 +0000 Received: from localhost ([127.0.0.1]:36144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ccopq-0005MM-SV for submit@debbugs.gnu.org; Sun, 12 Feb 2017 02:44:39 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:52496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ccopp-0005M9-3y for 25693-done@debbugs.gnu.org; Sun, 12 Feb 2017 02:44:37 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6CE56160052; Sat, 11 Feb 2017 23:44:31 -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 JfKHUOC7FhNS; Sat, 11 Feb 2017 23:44:30 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id C31CF160054; Sat, 11 Feb 2017 23:44:30 -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 WjMP6jaxY7GL; Sat, 11 Feb 2017 23:44:30 -0800 (PST) Received: from [192.168.1.9] (unknown [47.153.188.248]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id A6E64160052; Sat, 11 Feb 2017 23:44:30 -0800 (PST) Subject: Re: bug#25693: -A and mixed line terminators To: Norbert de Jonge , 25693-done@debbugs.gnu.org References: <20170212031418.6e49bcfd@ren> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <1dc054cd-ef7b-6186-5671-10f7b7fa6b17@cs.ucla.edu> Date: Sat, 11 Feb 2017 23:44:30 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170212031418.6e49bcfd@ren> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 25693-done 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: -0.0 (/) Norbert de Jonge wrote: > I'm requesting 10000 lines of trailing context, which is more lines > than the entire file, but output is prematurely cut off. The last line of output is "Binary file 4a.html matches", which indicates that the output would otherwise have data that is improperly encoded for your locale. Try using the -a option, or use the C locale (set LC_ALL=C in your environment). ------------=_1486885502-20648-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 12 Feb 2017 02:14:39 +0000 Received: from localhost ([127.0.0.1]:36080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ccjgV-0000vC-6w for submit@debbugs.gnu.org; Sat, 11 Feb 2017 21:14:39 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60185) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ccjgS-0000uz-Uv for submit@debbugs.gnu.org; Sat, 11 Feb 2017 21:14:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ccjgM-0006ca-Nu for submit@debbugs.gnu.org; Sat, 11 Feb 2017 21:14:31 -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_40 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47249) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ccjgM-0006cU-Kb for submit@debbugs.gnu.org; Sat, 11 Feb 2017 21:14:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccjgL-0008Mn-Dn for bug-grep@gnu.org; Sat, 11 Feb 2017 21:14:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ccjgI-0006Zr-8Q for bug-grep@gnu.org; Sat, 11 Feb 2017 21:14:29 -0500 Received: from relay4.webreus.nl ([46.235.46.212]:39119) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccjgI-0006ZA-24 for bug-grep@gnu.org; Sat, 11 Feb 2017 21:14:26 -0500 Received: from srv253033.webreus.nl (srv045033.webreus.nl [46.235.45.33]) by relay4.webreus.nl (Postfix) with ESMTP id 1B80B17D700CB for ; Sun, 12 Feb 2017 03:14:22 +0100 (CET) Received: (qmail 26590 invoked from network); 12 Feb 2017 03:14:21 +0100 Received: from 77-173-90-33.ip.telfort.nl (HELO ren) (77.173.90.33) by srv045033.webreus.nl with (AES128-SHA encrypted) SMTP; 12 Feb 2017 03:14:21 +0100 Date: Sun, 12 Feb 2017 03:14:18 +0100 From: Norbert de Jonge To: bug-grep@gnu.org Subject: -A and mixed line terminators Message-ID: <20170212031418.6e49bcfd@ren> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit 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: -5.0 (-----) Hi, I don't know if this is a bug or not, but -A does not seem to properly deal with mixed line terminators. Here's a way to replicate the issue. $ wget http://www.popot.org/popuw_forum_archive/4a.html $ file 4a.html $ wc -l 4a.html $ grep -A 10000 tul 4a.html $ tail 4a.html I'm requesting 10000 lines of trailing context, which is more lines than the entire file, but output is prematurely cut off. Best regards, Norbert ------------=_1486885502-20648-1--