Report forwarded to debian-bugs-dist@lists.debian.org, Wichert Akkerman <wakkerma@debian.org>:
Bug#76011; Package grep.   debian-bugs-dist@lists.debian.orgWichert Akkerman  Subject: Bug#76011: grep: [PATCH] "grep -lc" should Do The Right Thing Reply-To: Peter Samuelson , 76011@bugs.debian.org Resent-From: Peter Samuelson Resent-To: debian-bugs-dist@lists.debian.org Resent-CC: Wichert Akkerman Resent-Date: Wed, 01 Nov 2000 07:03:01 GMT Resent-Message-ID: Resent-Sender: owner@bugs.debian.org X-Debian-PR-Message: report 76011 X-Debian-PR-Package: grep X-Debian-PR-Keywords: X-Loop: owner@bugs.debian.org Received: via spool by bugs@bugs.debian.org id=B.97305834810905 (code B ref -1); Wed, 01 Nov 2000 07:03:01 GMT From: Peter Samuelson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14847.45354.638266.208512@wire.cadcamlab.org> Date: Tue, 31 Oct 2000 23:59:06 -0600 (CST) To: submit@bugs.debian.org X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid X-Face: ?*2Jm8R'OlE|+C~V>u$CARJyKMOpJ"^kNhLusXnPTFBF!#8,jH/#=Iy(?ehN$jH }x;J6B@[z.Ad\Be5RfNB*1>Eh.'R%u2gRj)M4blT]vu%^QqAcknowledgement sent to Peter Samuelson <peter@cadcamlab.org>:
New Bug report received and forwarded. Copy sent to Wichert Akkerman <wakkerma@debian.org>.   -t  From: owner@bugs.debian.org (Debian Bug Tracking System) To: Peter Samuelson Subject: Bug#76011: Acknowledgement (grep: [PATCH] "grep -lc" should Do The Right Thing) Message-ID: In-Reply-To: <14847.45354.638266.208512@wire.cadcamlab.org> References: <14847.45354.638266.208512@wire.cadcamlab.org> X-Debian-PR-Message: ack 76011 Thank you for the problem report you have sent regarding Debian. This is an automatically generated reply, to let you know your message has been received. It is being forwarded to the developers mailing list for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): Wichert Akkerman If you wish to submit further information on your problem, please send it to 76011@bugs.debian.org (and *not* to bugs@bugs.debian.org). Please do not reply to the address at the top of this message, unless you wish to report a problem with the Bug-tracking system. Darren Benham (administrator, Debian Bugs database)   Received: (at submit) by bugs.debian.org; 1 Nov 2000 05:59:08 +0000 From peter@cadcamlab.org Tue Oct 31 23:59:08 2000 Return-path: Received: from wire.cadcamlab.org [::ffff:156.26.20.181] by master.debian.org with esmtp (Exim 3.12 1 (Debian)) id 13qqvU-0002po-00; Tue, 31 Oct 2000 23:59:08 -0600 Received: from peter by wire.cadcamlab.org with local (Exim 3.16 #1 (Debian)) id 13qqvT-0004im-00 for ; Wed, 01 Nov 2000 05:59:07 +0000 From: Peter Samuelson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14847.45354.638266.208512@wire.cadcamlab.org> Date: Tue, 31 Oct 2000 23:59:06 -0600 (CST) To: submit@bugs.debian.org Subject: grep: [PATCH] "grep -lc" should Do The Right Thing X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid X-Face: ?*2Jm8R'OlE|+C~V>u$CARJyKMOpJ"^kNhLusXnPTFBF!#8,jH/#=Iy(?ehN$jH }x;J6B@[z.Ad\Be5RfNB*1>Eh.'R%u2gRj)M4blT]vu%^QqMerged 35516 76011. Request was from Colin Watson <cjwatson@flatline.org.uk> to control@bugs.debian.org.   Received: (at control) by bugs.debian.org; 14 Aug 2001 16:25:43 +0000 From cjw44@flatline.org.uk Tue Aug 14 11:25:43 2001 Return-path: Received: from mccoy.flatline.org.uk [195.8.181.200] (mail) by master.debian.org with esmtp (Exim 3.12 1 (Debian)) id 15Wh0h-0007ub-00; Tue, 14 Aug 2001 11:25:43 -0500 Received: from cjw44 by mccoy.flatline.org.uk with local (Exim 3.12 #1 (Debian)) id 15Wh0e-0003uy-00; Tue, 14 Aug 2001 17:25:40 +0100 Date: Tue, 14 Aug 2001 17:25:40 +0100 From: Colin Watson To: control@bugs.debian.org Subject: Duplicate grep bugs Message-ID: <20010814172540.H12922@flatline.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: Colin Watson Delivered-To: control@bugs.debian.org merge 35516 76011 retitle 76011 "grep -lc" should Do The Right Thing tags 35516 patch thanks -- Colin Watson [cjwatson@flatline.org.uk]   Changed Bug title. Request was from Colin Watson <cjwatson@flatline.org.uk> to control@bugs.debian.org.   Received: (at control) by bugs.debian.org; 14 Aug 2001 16:25:43 +0000 From cjw44@flatline.org.uk Tue Aug 14 11:25:43 2001 Return-path: Received: from mccoy.flatline.org.uk [195.8.181.200] (mail) by master.debian.org with esmtp (Exim 3.12 1 (Debian)) id 15Wh0h-0007ub-00; Tue, 14 Aug 2001 11:25:43 -0500 Received: from cjw44 by mccoy.flatline.org.uk with local (Exim 3.12 #1 (Debian)) id 15Wh0e-0003uy-00; Tue, 14 Aug 2001 17:25:40 +0100 Date: Tue, 14 Aug 2001 17:25:40 +0100 From: Colin Watson To: control@bugs.debian.org Subject: Duplicate grep bugs Message-ID: <20010814172540.H12922@flatline.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: Colin Watson Delivered-To: control@bugs.debian.org merge 35516 76011 retitle 76011 "grep -lc" should Do The Right Thing tags 35516 patch thanks -- Colin Watson [cjwatson@flatline.org.uk]   Tags added: patch Request was from Colin Watson <cjwatson@flatline.org.uk> to control@bugs.debian.org.   Received: (at control) by bugs.debian.org; 14 Aug 2001 16:25:43 +0000 From cjw44@flatline.org.uk Tue Aug 14 11:25:43 2001 Return-path: Received: from mccoy.flatline.org.uk [195.8.181.200] (mail) by master.debian.org with esmtp (Exim 3.12 1 (Debian)) id 15Wh0h-0007ub-00; Tue, 14 Aug 2001 11:25:43 -0500 Received: from cjw44 by mccoy.flatline.org.uk with local (Exim 3.12 #1 (Debian)) id 15Wh0e-0003uy-00; Tue, 14 Aug 2001 17:25:40 +0100 Date: Tue, 14 Aug 2001 17:25:40 +0100 From: Colin Watson To: control@bugs.debian.org Subject: Duplicate grep bugs Message-ID: <20010814172540.H12922@flatline.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: Colin Watson Delivered-To: control@bugs.debian.org merge 35516 76011 retitle 76011 "grep -lc" should Do The Right Thing tags 35516 patch thanks -- Colin Watson [cjwatson@flatline.org.uk]   Information forwarded to debian-bugs-dist@lists.debian.org, Robert van der Meulen <rvdm@debian.org>, grep@packages.qa.debian.org:
Bug#76011; Package grep.   debian-bugs-dist@lists.debian.orgRobert van der Meulen grep@packages.qa.debian.org  X-Loop: owner@bugs.debian.org Subject: Bug#76011: grep: [PATCH] "grep -lc" should Do The Right Thing Reply-To: Martin Michlmayr , 76011@bugs.debian.org Resent-From: Martin Michlmayr Resent-To: debian-bugs-dist@lists.debian.org Resent-CC: Robert van der Meulen , grep@packages.qa.debian.org Resent-Date: Mon, 12 Aug 2002 22:03:03 GMT Resent-Message-ID: Resent-Sender: owner@bugs.debian.org X-Debian-PR-Message: report 76011 X-Debian-PR-Package: grep X-Debian-PR-Keywords: patch Received: via spool by 76011-submit@bugs.debian.org id=B76011.102918954218811 (code B ref 76011); Mon, 12 Aug 2002 22:03:03 GMT Date: Mon, 12 Aug 2002 23:58:48 +0200 From: Martin Michlmayr To: Peter Samuelson Cc: 76011@bugs.debian.org Message-ID: <20020812235848.A10894@fisch.cyrius.com> References: <14847.45354.638266.208512@wire.cadcamlab.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14847.45354.638266.208512@wire.cadcamlab.org> User-Agent: Mutt/1.3.22i Delivered-To: 76011@bugs.debian.org See http://bugs.debian.org/76011 * Peter Samuelson [2000-10-31 23:59]: > -l, --files-with-matches only print FILE names containing matches > -c, --count only print a count of matching lines per FILE > > It seems only logical that 'grep -lc' would count the matching lines > per file, but skip files with no matches. Obvious, right? (: But the > > --- src/grep.c~ Tue Feb 1 23:49:07 2000 > +++ src/grep.c Tue Oct 31 23:42:44 2000 > @@ -849,7 +849,7 @@ While your patch works with grep 2.4.x, it doesn't produce your intended behavior with the new version 2.5. Could you make a patch against 2.5? -- Martin Michlmayr tbm@cyrius.com   Acknowledgement sent to Martin Michlmayr <tbm@cyrius.com>:
Extra info received and forwarded to list. Copy sent to Robert van der Meulen <rvdm@debian.org>, grep@packages.qa.debian.org.   -t  X-Loop: owner@bugs.debian.org From: owner@bugs.debian.org (Debian Bug Tracking System) To: Martin Michlmayr Subject: Bug#76011: Info received (was grep: [PATCH] "grep -lc" should Do The Right Thing) Message-ID: In-Reply-To: <20020812235848.A10894@fisch.cyrius.com> References: <20020812235848.A10894@fisch.cyrius.com> X-Debian-PR-Message: ack-info 76011 X-Reply-To-disabled-by-doogie-because-it-can-wreak-havoc: 76011@bugs.debian.org Thank you for the additional information you have supplied regarding this problem report. It has been forwarded to the developer(s) and to the developers mailing list to accompany the original report. Your message has been sent to the package maintainer(s): Robert van der Meulen If you wish to continue to submit further information on your problem, please send it to 76011@bugs.debian.org, as before. Please do not reply to the address at the top of this message, unless you wish to report a problem with the Bug-tracking system. Debian bug tracking system administrator (administrator, Debian Bugs database)   Received: (at 76011) by bugs.debian.org; 12 Aug 2002 21:59:02 +0000 From tbm@cyrius.com Mon Aug 12 16:59:02 2002 Return-path: Received: from gtso-c3477b5b.dsl.mediaways.net (mail.frosty-geek.net) [195.71.123.91] by master.debian.org with esmtp (Exim 3.12 1 (Debian)) id 17eNDK-0004tM-00; Mon, 12 Aug 2002 16:59:02 -0500 Received: by mail.frosty-geek.net (Postfix, from userid 10) id 9B9FF2FF02; Mon, 12 Aug 2002 23:59:00 +0200 (CEST) Received: by fisch.cyrius.com (Postfix, from userid 1000) id 667F422EDB; Mon, 12 Aug 2002 23:58:48 +0200 (CEST) Date: Mon, 12 Aug 2002 23:58:48 +0200 From: Martin Michlmayr To: Peter Samuelson Cc: 76011@bugs.debian.org Subject: Re: grep: [PATCH] "grep -lc" should Do The Right Thing Message-ID: <20020812235848.A10894@fisch.cyrius.com> References: <14847.45354.638266.208512@wire.cadcamlab.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14847.45354.638266.208512@wire.cadcamlab.org> User-Agent: Mutt/1.3.22i Delivered-To: 76011@bugs.debian.org See http://bugs.debian.org/76011 * Peter Samuelson [2000-10-31 23:59]: > -l, --files-with-matches only print FILE names containing matches > -c, --count only print a count of matching lines per FILE > > It seems only logical that 'grep -lc' would count the matching lines > per file, but skip files with no matches. Obvious, right? (: But the > > --- src/grep.c~ Tue Feb 1 23:49:07 2000 > +++ src/grep.c Tue Oct 31 23:42:44 2000 > @@ -849,7 +849,7 @@ While your patch works with grep 2.4.x, it doesn't produce your intended behavior with the new version 2.5. Could you make a patch against 2.5? -- Martin Michlmayr tbm@cyrius.com   Tags removed: patch Request was from Martin Michlmayr <tbm@cyrius.com> to control@bugs.debian.org.   Received: (at control) by bugs.debian.org; 12 Aug 2002 21:59:46 +0000 From tbm@cyrius.com Mon Aug 12 16:59:46 2002 Return-path: Received: from gtso-c3477b5b.dsl.mediaways.net (mail.frosty-geek.net) [195.71.123.91] by master.debian.org with esmtp (Exim 3.12 1 (Debian)) id 17eNE1-0004uP-00; Mon, 12 Aug 2002 16:59:45 -0500 Received: by mail.frosty-geek.net (Postfix, from userid 10) id C85E42FF02; Mon, 12 Aug 2002 23:59:44 +0200 (CEST) Received: by fisch.cyrius.com (Postfix, from userid 1000) id EB79922EDB; Mon, 12 Aug 2002 23:59:38 +0200 (CEST) Date: Mon, 12 Aug 2002 23:59:38 +0200 From: Martin Michlmayr To: control@bugs.debian.org Subject: [tbm@cyrius.com: Re: grep: [PATCH] "grep -lc" should Do The Right Thing] Message-ID: <20020812235938.A10956@fisch.cyrius.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.22i Delivered-To: control@bugs.debian.org tags 76011 - patch thanks The patch doesn't work with grep 2.5. ----- Forwarded message from Martin Michlmayr ----- From: Martin Michlmayr Subject: Re: grep: [PATCH] "grep -lc" should Do The Right Thing Date: Mon, 12 Aug 2002 23:58:48 +0200 To: Peter Samuelson Cc: 76011@bugs.debian.org User-Agent: Mutt/1.3.22i See http://bugs.debian.org/76011 * Peter Samuelson [2000-10-31 23:59]: > -l, --files-with-matches only print FILE names containing matches > -c, --count only print a count of matching lines per FILE > > It seems only logical that 'grep -lc' would count the matching lines > per file, but skip files with no matches. Obvious, right? (: But the > > --- src/grep.c~ Tue Feb 1 23:49:07 2000 > +++ src/grep.c Tue Oct 31 23:42:44 2000 > @@ -849,7 +849,7 @@ While your patch works with grep 2.4.x, it doesn't produce your intended behavior with the new version 2.5. Could you make a patch against 2.5? -- Martin Michlmayr tbm@cyrius.com ----- End forwarded message ----- -- Martin Michlmayr tbm@cyrius.com   Information forwarded to debian-bugs-dist@lists.debian.org, Robert van der Meulen <rvdm@debian.org>, grep@packages.qa.debian.org:
Bug#76011; Package grep.   debian-bugs-dist@lists.debian.orgRobert van der Meulen grep@packages.qa.debian.org  X-Loop: owner@bugs.debian.org Subject: Bug#76011: grep: [PATCH] "grep -lc" should Do The Right Thing Reply-To: Peter Samuelson , 76011@bugs.debian.org Resent-From: Peter Samuelson Resent-To: debian-bugs-dist@lists.debian.org Resent-CC: Robert van der Meulen , grep@packages.qa.debian.org Resent-Date: Mon, 12 Aug 2002 22:33:10 GMT Resent-Message-ID: Resent-Sender: owner@bugs.debian.org X-Debian-PR-Message: report 76011 X-Debian-PR-Package: grep X-Debian-PR-Keywords: Received: via spool by 76011-submit@bugs.debian.org id=B76011.102919133123713 (code B ref 76011); Mon, 12 Aug 2002 22:33:10 GMT Date: Mon, 12 Aug 2002 17:28:47 -0500 To: 76011@bugs.debian.org Message-ID: <20020812222847.GC761@cadcamlab.org> References: <14847.45354.638266.208512@wire.cadcamlab.org> <20020812235848.A10894@fisch.cyrius.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020812235848.A10894@fisch.cyrius.com> User-Agent: Mutt/1.4i From: Peter Samuelson Delivered-To: 76011@bugs.debian.org [Martin Michlmayr] > While your patch works with grep 2.4.x, it doesn't produce your > intended behavior with the new version 2.5. Could you make a patch > against 2.5? Sure. This one seems to work. --- src/grep.c~ 2002-03-13 08:49:52.000000000 -0600 +++ src/grep.c 2002-08-12 17:24:02.000000000 -0500 @@ -945,7 +945,7 @@ status = count + 2; else { - if (count_matches) + if (count_matches && (count || (count_matches == 1))) { if (out_file) printf ("%s%c", filename, ':' & filename_mask); @@ -1626,14 +1626,23 @@ } /* POSIX.2 says that -q overrides -l, which in turn overrides the - other output options. */ + other output options. We violate this slightly by allowing -c + and -l to coexist (print 'file:count' but skip if count==0). */ if (exit_on_match) - list_files = 0; - if (exit_on_match | list_files) { + list_files = 0; count_matches = 0; done_on_match = 1; } + else if (list_files && count_matches) + { + list_files = 0; + count_matches = 2; + done_on_match = 0; + } + else if (list_files) + done_on_match = 1; + out_quiet = count_matches | done_on_match; if (out_after < 0)   Acknowledgement sent to Peter Samuelson <peter@cadcamlab.org>:
Extra info received and forwarded to list. Copy sent to Robert van der Meulen <rvdm@debian.org>, grep@packages.qa.debian.org.   -t  X-Loop: owner@bugs.debian.org From: owner@bugs.debian.org (Debian Bug Tracking System) To: Peter Samuelson Subject: Bug#76011: Info received (was grep: [PATCH] "grep -lc" should Do The Right Thing) Message-ID: In-Reply-To: <20020812222847.GC761@cadcamlab.org> References: <20020812222847.GC761@cadcamlab.org> X-Debian-PR-Message: ack-info 76011 X-Reply-To-disabled-by-doogie-because-it-can-wreak-havoc: 76011@bugs.debian.org Thank you for the additional information you have supplied regarding this problem report. It has been forwarded to the developer(s) and to the developers mailing list to accompany the original report. Your message has been sent to the package maintainer(s): Robert van der Meulen If you wish to continue to submit further information on your problem, please send it to 76011@bugs.debian.org, as before. Please do not reply to the address at the top of this message, unless you wish to report a problem with the Bug-tracking system. Debian bug tracking system administrator (administrator, Debian Bugs database)   Received: (at 76011) by bugs.debian.org; 12 Aug 2002 22:28:51 +0000 From peter@cadcamlab.org Mon Aug 12 17:28:51 2002 Return-path: Received: from surf.cadcamlab.org [156.26.20.182] (mail) by master.debian.org with esmtp (Exim 3.12 1 (Debian)) id 17eNgB-0006AP-00; Mon, 12 Aug 2002 17:28:51 -0500 Received: from peter by surf.cadcamlab.org with local (Exim 3.35 #1 (Debian)) id 17eNg7-0002NR-00 for <76011@bugs.debian.org>; Mon, 12 Aug 2002 17:28:47 -0500 Date: Mon, 12 Aug 2002 17:28:47 -0500 To: 76011@bugs.debian.org Subject: Re: grep: [PATCH] "grep -lc" should Do The Right Thing Message-ID: <20020812222847.GC761@cadcamlab.org> References: <14847.45354.638266.208512@wire.cadcamlab.org> <20020812235848.A10894@fisch.cyrius.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020812235848.A10894@fisch.cyrius.com> User-Agent: Mutt/1.4i From: Peter Samuelson Delivered-To: 76011@bugs.debian.org [Martin Michlmayr] > While your patch works with grep 2.4.x, it doesn't produce your > intended behavior with the new version 2.5. Could you make a patch > against 2.5? Sure. This one seems to work. --- src/grep.c~ 2002-03-13 08:49:52.000000000 -0600 +++ src/grep.c 2002-08-12 17:24:02.000000000 -0500 @@ -945,7 +945,7 @@ status = count + 2; else { - if (count_matches) + if (count_matches && (count || (count_matches == 1))) { if (out_file) printf ("%s%c", filename, ':' & filename_mask); @@ -1626,14 +1626,23 @@ } /* POSIX.2 says that -q overrides -l, which in turn overrides the - other output options. */ + other output options. We violate this slightly by allowing -c + and -l to coexist (print 'file:count' but skip if count==0). */ if (exit_on_match) - list_files = 0; - if (exit_on_match | list_files) { + list_files = 0; count_matches = 0; done_on_match = 1; } + else if (list_files && count_matches) + { + list_files = 0; + count_matches = 2; + done_on_match = 0; + } + else if (list_files) + done_on_match = 1; + out_quiet = count_matches | done_on_match; if (out_after < 0)   Tags added: patch Request was from Touko Korpela <tkorpela@phnet.fi> to control@bugs.debian.org.   Received: (at control) by bugs.debian.org; 18 Sep 2007 13:01:26 +0000 From tkorpela@phnet.fi Tue Sep 18 13:01:26 2007 X-Spam-Checker-Version: SpamAssassin 3.1.4-bugs.debian.org_2005_01_02 (2006-07-26) on rietz.debian.org X-Spam-Level: X-Spam-Status: No, score=-4.7 required=4.0 tests=BAYES_00,FORGED_RCVD_HELO, MDO_AUTORESP3,MURPHY_DRUGS_REL8,VALID_BTS_CONTROL autolearn=no version=3.1.4-bugs.debian.org_2005_01_02 Return-path: Received: from outbound-mx3.phnet.fi ([62.165.128.248]) by rietz.debian.org with esmtp (Exim 4.50) id 1IXchi-0007jJ-0n for control@bugs.debian.org; Tue, 18 Sep 2007 13:01:26 +0000 Received: from localhost (localhost [127.0.0.1]) by outbound-mx3.phnet.fi (Postfix) with ESMTP id DD0B2B3B4E for ; Tue, 18 Sep 2007 16:01:18 +0300 (EEST) X-Virus-Scanned: amavisd-new at outbound-mx3.phnet.fi Received: from outbound-mx3.phnet.fi ([127.0.0.1]) by localhost (outbound-mx3.phnet.fi [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZCwd6ZbRohOg for ; Tue, 18 Sep 2007 16:01:18 +0300 (EEST) Received: from norsu.vuoristo.local (bb-81-175-155-104.dsl.phnet.fi [81.175.155.104]) by outbound-mx3.phnet.fi (Postfix) with ESMTP id AC704B3B42 for ; Tue, 18 Sep 2007 16:01:18 +0300 (EEST) Received: from touko by norsu.vuoristo.local with local (Exim 4.67) (envelope-from ) id 1IXchg-0000k3-MD for control@bugs.debian.org; Tue, 18 Sep 2007 16:01:24 +0300 To: control@bugs.debian.org Subject: tagging 76011 X-BTS-Version: 2.10.7 Message-Id: From: Touko Korpela Date: Tue, 18 Sep 2007 16:01:24 +0300 Delivered-To: control@bugs.debian.org # Automatically generated email from bts, devscripts version 2.10.7 tags 76011 patch