GNU bug report logs - #33062
grep matches too lazily when invoked with -zoP and matching backreference followed by 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; Reported by: Johannes Riecken <johannes.riecken@HIDDEN>; Keywords: notabug; Done: Paul Eggert <eggert@HIDDEN>; Maintainer for grep is bug-grep@HIDDEN.
bug closed, send any further explanations to 33062 <at> debbugs.gnu.org and Johannes Riecken <johannes.riecken@HIDDEN> Request was from Paul Eggert <eggert@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) notabug. Request was from Paul Eggert <eggert@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 33062) by debbugs.gnu.org; 28 Oct 2018 12:19:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 28 08:19:29 2018
Received: from localhost ([127.0.0.1]:46764 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gGk2T-0006oy-6H
	for submit <at> debbugs.gnu.org; Sun, 28 Oct 2018 08:19:29 -0400
Received: from mail-wr1-f47.google.com ([209.85.221.47]:33951)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <meyering@HIDDEN>) id 1gGk2R-0006oi-9F
 for 33062 <at> debbugs.gnu.org; Sun, 28 Oct 2018 08:19:27 -0400
Received: by mail-wr1-f47.google.com with SMTP id l6-v6so5706749wrt.1
 for <33062 <at> debbugs.gnu.org>; Sun, 28 Oct 2018 05:19:27 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=J/oahCyQycuSNuzM7pErUj+5kwcHcsG5Usx9mAwIwSQ=;
 b=qkSL9bfwq7BguX2eMljiHO5lMN6uLDgLoDV629gPhJF8Q1HZE7cW7ZyWi881BUTaLX
 IURjjEfI42D9GwI0QaXB9jojOZfiK5wphxMMaSEVyVaR9EuaiC/dD4X/5MH2338uDD8+
 bIxpGUHJZzurxJnd8BDhrra9KQv8KexLAv3KHCvZ2VgMo4nrMZ2mS/EyDl4+QekTr5QS
 aTGJlcAY6hANyJBpr1hubuE3SEafN9vCv5xWFKCoYLaAStdkSGZqFI9BghFtzs5MB/+T
 IFtkkF/5cNVUi+badZanMOcECjRD1FsG0dpRWYTGvY/KbuNsGXaRvQcMMriYefzOWfA0
 be7Q==
X-Gm-Message-State: AGRZ1gLiWK7pxkFguquhjJP+cKjXNPfjxSTPIpgqNn5Vxg+6RghVNfs5
 +BpbLxvrgL3tUTopjz0EJnOELAp+G7f0LCTurmk=
X-Google-Smtp-Source: AJdET5dxGpvwvS+e+MSk1thE2IZGQpQWAssG6dMmoE2zMzjjpGrTkRDYUHP8j5xye5LecH5GchecfomRWlz0NPzqPRk=
X-Received: by 2002:adf:e9c1:: with SMTP id l1-v6mr9981133wrn.58.1540729161528; 
 Sun, 28 Oct 2018 05:19:21 -0700 (PDT)
MIME-Version: 1.0
References: <CAP9p3fEApD4rQXD_tjqHt8bvbP+QxM1epDFq9S+kmTknjiQnHA@HIDDEN>
In-Reply-To: <CAP9p3fEApD4rQXD_tjqHt8bvbP+QxM1epDFq9S+kmTknjiQnHA@HIDDEN>
From: Jim Meyering <jim@HIDDEN>
Date: Sun, 28 Oct 2018 12:19:09 +0000
Message-ID: <CA+8g5KFcFfnS5-jxFnk24GmF-PPpzm29_xKm9YhLejmNFASDeQ@HIDDEN>
Subject: Re: bug#33062: grep matches too lazily when invoked with -zoP and
 matching backreference followed by newline
To: johannes.riecken@HIDDEN
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 33062
Cc: 33062 <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: -0.7 (/)

tags 33062 notabug
close 33062
stop

On Tue, Oct 16, 2018 at 2:42 PM Johannes Riecken
<johannes.riecken@HIDDEN> wrote:
> *Bug summary: *GNU grep 3.0-2 matches too lazily when invoked with -zoP and
> matching backreference followed by newline
>
> *Steps to reproduce:*
>
> Create file cases:
>
> foo
> bar
>   cases:
>     1: foo
>     2: bar
> baz
>   cases:
>     3: baz
> quux
>
> And run grep -zoP '(\s*)cases:\n(\1.*\n)*' cases
>
> *Expected output:*
>
>   cases:
>     1: foo
>     2: bar
>   cases:
>     3: baz
>
> * Actual output:*
>
>   cases:
>
>   cases:

Thanks for the report.
However, this is not a bug.
The \s in your regexp matches the preceding newline, too, and that
forces the behavior you see.
I presume you wanted something like this:

$ printf '%s\n' foo bar '  cases:' '    1: foo' '    2: bar' baz '
cases:' '    3: baz' quux\
  | grep -zoP '( *)cases:\n(\1.*\n)*'
  cases:
    1: foo
    2: bar
  cases:
    3: baz

The adjusted regexp works because it accepts only spaces in the group.
Don't be tempted to allow TABs, but rather ensure the input is
expanded to use only spaces for indentation.




Information forwarded to bug-grep@HIDDEN:
bug#33062; Package grep. Full text available.

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


Received: (at 33062) by debbugs.gnu.org; 28 Oct 2018 10:31:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 28 06:31:39 2018
Received: from localhost ([127.0.0.1]:46725 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gGiM7-0002Am-1J
	for submit <at> debbugs.gnu.org; Sun, 28 Oct 2018 06:31:39 -0400
Received: from mout.kundenserver.de ([212.227.17.24]:36313)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1gGiM4-0002AZ-TB
 for 33062 <at> debbugs.gnu.org; Sun, 28 Oct 2018 06:31:37 -0400
Received: from [192.168.101.10] ([91.12.166.119]) by mrelayeu.kundenserver.de
 (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id
 1MSbp1-1g9x9N0DLV-00SyCP; Sun, 28 Oct 2018 11:31:28 +0100
Received: from [192.168.101.10] ([91.12.166.119]) by mrelayeu.kundenserver.de
 (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id
 1MSbp1-1g9x9N0DLV-00SyCP; Sun, 28 Oct 2018 11:31:28 +0100
Subject: Re: bug#33062: grep matches too lazily when invoked with -zoP and
 matching backreference followed by newline
To: Johannes Riecken <johannes.riecken@HIDDEN>, 33062 <at> debbugs.gnu.org,
 bug-grep@HIDDEN
References: <CAP9p3fEApD4rQXD_tjqHt8bvbP+QxM1epDFq9S+kmTknjiQnHA@HIDDEN>
 <a73342bf-f807-32ae-bb67-de2ed8d2bd40@HIDDEN>
 <CAP9p3fF6p5P1Rb=rniKxs=Pb4DY3phS5uqi6m4eOXCsF7rXrcw@HIDDEN>
From: Bernhard Voelker <mail@HIDDEN>
Openpgp: preference=signencrypt
Autocrypt: addr=mail@HIDDEN; prefer-encrypt=mutual; keydata=
 xsBNBFPirzMBCACyzYldTjQ4ufFOkByY5Nn5USb5GFoL48nWBwNHjd9KUbtRRNlQiPNKd6hK
 Gvd3BG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J63siNyUlVnVMSzDgTJl+s
 l/DMabXpqrJQx3/1Yy6mTaDs3XZT/wmBKaTLXx/LByaPxQQ7ABEBAAHCwF8EGAECAAkFAlPi
 rzMCGwwACgkQRlAu95aRcZWVPwgAqZT6iTXkoP37wYb41323RzhBcJ8JSk4cyBDBUXX0lMrM
 3qhiClKG7phpxVdu817Gwc6Hsecg7FfjQAV8MHQ0ZFeEFdk3b2rKBqfsStc+h49/xF3Fb+if
 CzR9qeQF82fMSxkg18++7hMcHCMO/hPZ/Q0xRi+lrSr2QKDJQuLzSyVU14TxrCkevZjEhtma
 VNvcJlJzCbiBXee9Fpc5jITUXPFG8E8dxqo1n+duOyIMgozrAnzP7X5V/Ob/Ozf/aGGX9+Jd
 inyfCX18nWcHALKMU/36Eua/ylalf/2c2YkBp9KCLVmGgPkUgW52EeRPgroIsiwu+rwCSV6Z
 UyCJ+OymCg==
Message-ID: <e67b302b-57a0-9624-34cf-b3d5d1310c42@HIDDEN>
Date: Sun, 28 Oct 2018 11:31:26 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.2.1
MIME-Version: 1.0
In-Reply-To: <CAP9p3fF6p5P1Rb=rniKxs=Pb4DY3phS5uqi6m4eOXCsF7rXrcw@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Provags-ID: V03:K1:3+nGBiJ1IiZdu7BpNJRWvCbi5UBsOg7vGaK1eAOjFIKbEd6hHez
 r97glAkNnaD+TZd/FwBfRKU4g26HNMgf3JE9FZslBJfRw81VWBs2nmPJ1zsgluYhgP22sf4
 OyD5x4mlpB/Qg5IPTSKlNGkV2BrMsqKQSp/7iO9heG2KMp/Hj/fjdy5TcR0PPURzW/OF7z+
 QyPxwEsMmwk6+kLrJjZPQ==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V01:K0:2uYggWQk4lY=:XQ2BPfqznCcC1mKLd/Nbhk
 mvla5Ssmf9W8v5eM3twXLhdLgQxmc3p3TMVa0cBY9KPiAOLRx640QWN5Z1iB9AYdsAOGu/6pK
 Ro3AB7IByLVObU477hVvx+zxPyFezizWqROpN0abcZ/AZ9MNSPlPP0JveycfE1Ze5X1nNyZAg
 eedkYZF4E6RvWBa0gWVtVIqg49sPFaBsNMvnD1UKim1b5bdqYncy8vYzB/oZjtO58W+q7ezxQ
 5I3C9iBCwgx/wyo160LMuMPrz/HoobvR1RGMCBHun13AwKCVpuMtlK24HTMV3g1r9p2bEt933
 c7cilVOe6ds7mpjQygR7ncvx2OOk5nfsSpjYlmKkLaDYElMIbp31YccAGXi1UpHw0cMdVMouf
 i8QZtQgoANxFz4PGi4LMZcwoJi/oTm++AalIvuBvotK7btPBRmQGmcPGB5vzCdN3Wz8lzIi6w
 VQUrAh8erZ1GxsQ0Q0sOdjKPwu6egkVcfY3fenb+pIFyjkYuywsG/zNaOe/3I7zMTGJBDrHqQ
 P8Kjbxcn+yD72ruCe2tBf8svUfD5TVZ5KsrUcJgOPNA5yScEBCspre95rFVC1WIOCfp92QaCf
 YUNcvTR689mwrZ1xWggQZ0UkspIgY8WFJzLh1/3gfOg6VSpUW1TSg3XU4z3o9bHsqOYWQbXhm
 6D1urHp+td1taZuzrlpFIN83+YAlZIFEOHwECWA5Yc8calzUjVydi79i9bMlNhJWZH0dgLnZh
 UOSlabtpZLCMxzBc
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 33062
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: -1.0 (-)

On 10/28/18 8:32 AM, Johannes Riecken wrote:
>> On Wed, Oct 24, 2018 at 1:17 AM Bernhard Voelker <mail@HIDDEN <mailto:mail@HIDDEN>> wrote:
>> reassign 33062 grep
>> stop
>>> On 10/16/18 2:55 PM, Johannes Riecken wrote:
>>> Dear maintainers:
>>>
>>> *Bug summary: *GNU grep 3.0-2 matches too lazily when invoked with -zoP and
>>> matching backreference followed by newline
>>>
>>> *Steps to reproduce:*
>>>
>>> Create file cases:
>>>
>>> foo
>>> bar
>>>   cases:
>>>     1: foo
>>>     2: bar
>>> baz
>>>   cases:
>>>     3: baz
>>> quux
>>>
>>> And run grep -zoP '(\s*)cases:\n(\1.*\n)*' cases
>>>
>>> *Expected output:*
>>>
>>>   cases:
>>>     1: foo
>>>     2: bar
>>>   cases:
>>>     3: baz
>>>
>>> * Actual output:*
>>>
>>>   cases:
>>>
>>>   cases:
>>>
>>> Best regards,
>>>
>>> Johannes Riecken
>>
>> Thanks for the report, however, you reached the GNU coreutils mailing list,
>> while your report is for 'grep'.
>>
>> I'm therefore reassigning this issue to the GNU 'grep' package.
>
> Thank you, could you please tell me where I can check the progress of my bug report after the reassignment? I didn't see
> it in the archives of the bug-grep mailing list.
> 
> Best wishes,
> Johannes

Well, it's still in the same GNU bug tracker:
  https://bugs.gnu.org/33062
but it seems that the bug wasn't forwarded automatically to the
bug-grep mailing list, thus adding that list explicitly ... hoping that
this doesn't open another bug.

Have a nice day,
Berny




Information forwarded to bug-grep@HIDDEN:
bug#33062; Package grep. Full text available.

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


Received: (at submit) by debbugs.gnu.org; 28 Oct 2018 10:31:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 28 06:31:58 2018
Received: from localhost ([127.0.0.1]:46728 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gGiMQ-0002BL-B9
	for submit <at> debbugs.gnu.org; Sun, 28 Oct 2018 06:31:58 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50261)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1gGiMN-0002B6-21
 for submit <at> debbugs.gnu.org; Sun, 28 Oct 2018 06:31:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <mail@HIDDEN>) id 1gGiMG-0003lm-Py
 for submit <at> debbugs.gnu.org; Sun, 28 Oct 2018 06:31:49 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:47211)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <mail@HIDDEN>)
 id 1gGiMG-0003lY-LU
 for submit <at> debbugs.gnu.org; Sun, 28 Oct 2018 06:31:48 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:59851)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <mail@HIDDEN>) id 1gGiMF-00008H-M6
 for bug-grep@HIDDEN; Sun, 28 Oct 2018 06:31:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <mail@HIDDEN>) id 1gGiMC-0003iE-CZ
 for bug-grep@HIDDEN; Sun, 28 Oct 2018 06:31:47 -0400
Received: from mout.kundenserver.de ([212.227.17.24]:51153)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <mail@HIDDEN>)
 id 1gGiMA-0003e7-W2
 for bug-grep@HIDDEN; Sun, 28 Oct 2018 06:31:44 -0400
Received: from [192.168.101.10] ([91.12.166.119]) by mrelayeu.kundenserver.de
 (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id
 1MSbp1-1g9x9N0DLV-00SyCP; Sun, 28 Oct 2018 11:31:28 +0100
Received: from [192.168.101.10] ([91.12.166.119]) by mrelayeu.kundenserver.de
 (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id
 1MSbp1-1g9x9N0DLV-00SyCP; Sun, 28 Oct 2018 11:31:28 +0100
Subject: Re: bug#33062: grep matches too lazily when invoked with -zoP and
 matching backreference followed by newline
To: Johannes Riecken <johannes.riecken@HIDDEN>, 33062 <at> debbugs.gnu.org,
 bug-grep@HIDDEN
References: <CAP9p3fEApD4rQXD_tjqHt8bvbP+QxM1epDFq9S+kmTknjiQnHA@HIDDEN>
 <a73342bf-f807-32ae-bb67-de2ed8d2bd40@HIDDEN>
 <CAP9p3fF6p5P1Rb=rniKxs=Pb4DY3phS5uqi6m4eOXCsF7rXrcw@HIDDEN>
From: Bernhard Voelker <mail@HIDDEN>
Openpgp: preference=signencrypt
Autocrypt: addr=mail@HIDDEN; prefer-encrypt=mutual; keydata=
 xsBNBFPirzMBCACyzYldTjQ4ufFOkByY5Nn5USb5GFoL48nWBwNHjd9KUbtRRNlQiPNKd6hK
 Gvd3BGi5aoFKA4ytfRk6jbAbW3jVb3R8wYaV08mOy4KVEKxqN4bxsXlMjNChXVR+rtKDmfI+
 oPTL+cPH2X6gW4W02IRbVw0uUhNm6zEedC/gNrY/mTlf1enZ46jxZ7BTUZaG+kx38UMISIMB
 zSzLRtdkwgmHj4jS3p1fF2cwRqLclIfMjKGpbNFPEXeXKWrCLcqHw78795eAR9q0YvrDkfIn
 GdDBwfb3VM4NdulwIFzvYZMSXvSbbyPLB5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9qeQF82fMSxkg18++7hMcHCMO/hPZ/Q0xRi+lrSr2QKDJQuLzSyVU14TxrCkevZjEhtma
 VNvcJlJzCbiBXee9Fpc5jITUXPFG8E8dxqo1n+duOyIMgozrAnzP7X5V/Ob/Ozf/aGGX9+Jd
 inyfCX18nWcHALKMU/36Eua/ylalf/2c2YkBp9KCLVmGgPkUgW52EeRPgroIsiwu+rwCSV6Z
 UyCJ+OymCg==
Message-ID: <e67b302b-57a0-9624-34cf-b3d5d1310c42@HIDDEN>
Date: Sun, 28 Oct 2018 11:31:26 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.2.1
MIME-Version: 1.0
In-Reply-To: <CAP9p3fF6p5P1Rb=rniKxs=Pb4DY3phS5uqi6m4eOXCsF7rXrcw@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Provags-ID: V03:K1:3+nGBiJ1IiZdu7BpNJRWvCbi5UBsOg7vGaK1eAOjFIKbEd6hHez
 r97glAkNnaD+TZd/FwBfRKU4g26HNMgf3JE9FZslBJfRw81VWBs2nmPJ1zsgluYhgP22sf4
 OyD5x4mlpB/Qg5IPTSKlNGkV2BrMsqKQSp/7iO9heG2KMp/Hj/fjdy5TcR0PPURzW/OF7z+
 QyPxwEsMmwk6+kLrJjZPQ==
X-UI-Out-Filterresults: notjunk:1;V01:K0:2uYggWQk4lY=:XQ2BPfqznCcC1mKLd/Nbhk
 mvla5Ssmf9W8v5eM3twXLhdLgQxmc3p3TMVa0cBY9KPiAOLRx640QWN5Z1iB9AYdsAOGu/6pK
 Ro3AB7IByLVObU477hVvx+zxPyFezizWqROpN0abcZ/AZ9MNSPlPP0JveycfE1Ze5X1nNyZAg
 eedkYZF4E6RvWBa0gWVtVIqg49sPFaBsNMvnD1UKim1b5bdqYncy8vYzB/oZjtO58W+q7ezxQ
 5I3C9iBCwgx/wyo160LMuMPrz/HoobvR1RGMCBHun13AwKCVpuMtlK24HTMV3g1r9p2bEt933
 c7cilVOe6ds7mpjQygR7ncvx2OOk5nfsSpjYlmKkLaDYElMIbp31YccAGXi1UpHw0cMdVMouf
 i8QZtQgoANxFz4PGi4LMZcwoJi/oTm++AalIvuBvotK7btPBRmQGmcPGB5vzCdN3Wz8lzIi6w
 VQUrAh8erZ1GxsQ0Q0sOdjKPwu6egkVcfY3fenb+pIFyjkYuywsG/zNaOe/3I7zMTGJBDrHqQ
 P8Kjbxcn+yD72ruCe2tBf8svUfD5TVZ5KsrUcJgOPNA5yScEBCspre95rFVC1WIOCfp92QaCf
 YUNcvTR689mwrZ1xWggQZ0UkspIgY8WFJzLh1/3gfOg6VSpUW1TSg3XU4z3o9bHsqOYWQbXhm
 6D1urHp+td1taZuzrlpFIN83+YAlZIFEOHwECWA5Yc8calzUjVydi79i9bMlNhJWZH0dgLnZh
 UOSlabtpZLCMxzBc
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
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 <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: -6.0 (------)

On 10/28/18 8:32 AM, Johannes Riecken wrote:
>> On Wed, Oct 24, 2018 at 1:17 AM Bernhard Voelker <mail@HIDDEN <mailto:mail@HIDDEN>> wrote:
>> reassign 33062 grep
>> stop
>>> On 10/16/18 2:55 PM, Johannes Riecken wrote:
>>> Dear maintainers:
>>>
>>> *Bug summary: *GNU grep 3.0-2 matches too lazily when invoked with -zoP and
>>> matching backreference followed by newline
>>>
>>> *Steps to reproduce:*
>>>
>>> Create file cases:
>>>
>>> foo
>>> bar
>>>   cases:
>>>     1: foo
>>>     2: bar
>>> baz
>>>   cases:
>>>     3: baz
>>> quux
>>>
>>> And run grep -zoP '(\s*)cases:\n(\1.*\n)*' cases
>>>
>>> *Expected output:*
>>>
>>>   cases:
>>>     1: foo
>>>     2: bar
>>>   cases:
>>>     3: baz
>>>
>>> * Actual output:*
>>>
>>>   cases:
>>>
>>>   cases:
>>>
>>> Best regards,
>>>
>>> Johannes Riecken
>>
>> Thanks for the report, however, you reached the GNU coreutils mailing list,
>> while your report is for 'grep'.
>>
>> I'm therefore reassigning this issue to the GNU 'grep' package.
>
> Thank you, could you please tell me where I can check the progress of my bug report after the reassignment? I didn't see
> it in the archives of the bug-grep mailing list.
> 
> Best wishes,
> Johannes

Well, it's still in the same GNU bug tracker:
  https://bugs.gnu.org/33062
but it seems that the bug wasn't forwarded automatically to the
bug-grep mailing list, thus adding that list explicitly ... hoping that
this doesn't open another bug.

Have a nice day,
Berny




Information forwarded to bug-grep@HIDDEN:
bug#33062; Package grep. Full text available.
bug reassigned from package 'coreutils' to 'grep'. Request was from Bernhard Voelker <mail@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 33062) by debbugs.gnu.org; 23 Oct 2018 23:17:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 23 19:17:08 2018
Received: from localhost ([127.0.0.1]:38907 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gF5v9-0001Hc-UH
	for submit <at> debbugs.gnu.org; Tue, 23 Oct 2018 19:17:08 -0400
Received: from mout.kundenserver.de ([217.72.192.75]:42537)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>)
 id 1gF5v7-0001Ba-UP; Tue, 23 Oct 2018 19:17:06 -0400
Received: from [192.168.101.10] ([91.12.166.119]) by mrelayeu.kundenserver.de
 (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id
 1MpUMc-1fpdWY1dk4-00puJh; Wed, 24 Oct 2018 01:16:58 +0200
Received: from [192.168.101.10] ([91.12.166.119]) by mrelayeu.kundenserver.de
 (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id
 1MpUMc-1fpdWY1dk4-00puJh; Wed, 24 Oct 2018 01:16:58 +0200
Subject: Re: bug#33062: grep matches too lazily when invoked with -zoP and
 matching backreference followed by newline
To: Johannes Riecken <johannes.riecken@HIDDEN>, 33062 <at> debbugs.gnu.org
References: <CAP9p3fEApD4rQXD_tjqHt8bvbP+QxM1epDFq9S+kmTknjiQnHA@HIDDEN>
From: Bernhard Voelker <mail@HIDDEN>
Openpgp: preference=signencrypt
Autocrypt: addr=mail@HIDDEN; prefer-encrypt=mutual; keydata=
 xsBNBFPirzMBCACyzYldTjQ4ufFOkByY5Nn5USb5GFoL48nWBwNHjd9KUbtRRNlQiPNKd6hK
 Gvd3BGi5aoFKA4ytfRk6jbAbW3jVb3R8wYaV08mOy4KVEKxqN4bxsXlMjNChXVR+rtKDmfI+
 oPTL+cPH2X6gW4W02IRbVw0uUhNm6zEedC/gNrY/mTlf1enZ46jxZ7BTUZaG+kx38UMISIMB
 zSzLRtdkwgmHj4jS3p1fF2cwRqLclIfMjKGpbNFPEXeXKWrCLcqHw78795eAR9q0YvrDkfIn
 GdDBwfb3VM4NdulwIFzv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/xF3Fb+if
 CzR9qeQF82fMSxkg18++7hMcHCMO/hPZ/Q0xRi+lrSr2QKDJQuLzSyVU14TxrCkevZjEhtma
 VNvcJlJzCbiBXee9Fpc5jITUXPFG8E8dxqo1n+duOyIMgozrAnzP7X5V/Ob/Ozf/aGGX9+Jd
 inyfCX18nWcHALKMU/36Eua/ylalf/2c2YkBp9KCLVmGgPkUgW52EeRPgroIsiwu+rwCSV6Z
 UyCJ+OymCg==
Message-ID: <a73342bf-f807-32ae-bb67-de2ed8d2bd40@HIDDEN>
Date: Wed, 24 Oct 2018 01:16:57 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.2.1
MIME-Version: 1.0
In-Reply-To: <CAP9p3fEApD4rQXD_tjqHt8bvbP+QxM1epDFq9S+kmTknjiQnHA@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Provags-ID: V03:K1:eSeQ7UwXHq6t9ONYL2IrgUrNF59og8nlGn+zwEf7TgJ4Mdu8Ija
 DJR04jHQfuTD54884m/glxCTqPF/J6XhC6WZPDM4FFfo+Uy6//4Qy2zigR2Ru/JgWYPgr/V
 hxAOqAMejtGCTj9BygSrjDQWXnb9g6zNoYSXP+v7Pc/jS6tJyI4o8Uikj/cVI6IrXq8vue+
 U1UDvNAQLueeeQOf0uTxA==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V01:K0:RNXNmvp7XmY=:TtqnYXfZXZ53ZgWZ2TXgH1
 k13zGFOXOXby54ehs08aH0O9ah4jD6C/dX/hkslKAh1ZdfQvAyCM7m2IfQS9fPzaqzuuvcgGJ
 EjloeSfNGDPxuwxAEx/cM+ocbmDX9NQJsMpFu7Gq8rb77Gfio19YVO9zPbgPP86GMC0px7Hg1
 M9qP0h2UnowTA4PqlPb4mfoEkwCBBRbikLitHWLlLBKbe4KK2L0iZ899/DikIMaEz6QX7KBn3
 dAhs5T+MbQfo6VxJk0ZRyGw61hWOYih+o5CZ7PhwE10vlMdy9+V1m6IDqUDaD9X2avWWs87nG
 QJqvqOb8vk2FJ4v5qiskgAnfLbByrhQT4C79rBj6kP63AEqjiZsr9jwHw3VRJdFt263UqBjol
 xjp3Xpx02l1dWy6FiLX9fYptk8nsi9oq1KlK67REabUQxyiq4sBFv4tB+zA1E8iWv9KoPLD4F
 YI7P/w6BY6B9cThbU89P4trURO4UNLzggMneMQzs4TIelpk0ulY/gKZ58mFMlskzBGh0pp3RF
 VGy6t5Rq7HNX7wQ7EJxTde1wJa90LBvXcSrRHQ9nLRn4WWCMNsIgbkcSMsdobiY1loLOZPbaV
 635muqaCPTxFJQ6PHnJARVbtmyg8zLgUgMVOvGVpMa3RTg4lMIlsO+8M+Apr1VexfGDrr6Vrg
 DRRheM919SK3jctNj+gL5bWvs01sKTv/1ERY/4qJW81dSgJO1YKDe2zjDc1Pvx6dKNLMpe7f1
 Qn5BTwhfFq80tn0a
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 33062
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: -1.0 (-)

reassign 33062 grep
stop

On 10/16/18 2:55 PM, Johannes Riecken wrote:
> Dear maintainers:
> 
> *Bug summary: *GNU grep 3.0-2 matches too lazily when invoked with -zoP and
> matching backreference followed by newline
> 
> *Steps to reproduce:*
> 
> Create file cases:
> 
> foo
> bar
>   cases:
>     1: foo
>     2: bar
> baz
>   cases:
>     3: baz
> quux
> 
> And run grep -zoP '(\s*)cases:\n(\1.*\n)*' cases
> 
> *Expected output:*
> 
>   cases:
>     1: foo
>     2: bar
>   cases:
>     3: baz
> 
> * Actual output:*
> 
>   cases:
> 
>   cases:
> 
> Best regards,
> 
> Johannes Riecken

Thanks for the report, however, you reached the GNU coreutils mailing list,
while your report is for 'grep'.

I'm therefore reassigning this issue to the GNU 'grep' package.

Have a nice day,
Berny





Information forwarded to bug-coreutils@HIDDEN:
bug#33062; Package coreutils. Full text available.

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


Received: (at submit) by debbugs.gnu.org; 16 Oct 2018 14:41:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 16 10:41:17 2018
Received: from localhost ([127.0.0.1]:53798 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1gCQX6-0006ti-SZ
	for submit <at> debbugs.gnu.org; Tue, 16 Oct 2018 10:41:17 -0400
Received: from eggs.gnu.org ([208.118.235.92]:39438)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <johannes.riecken@HIDDEN>) id 1gCOtD-0003tA-Qi
 for submit <at> debbugs.gnu.org; Tue, 16 Oct 2018 08:56:00 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <johannes.riecken@HIDDEN>) id 1gCOt7-0000ki-MO
 for submit <at> debbugs.gnu.org; Tue, 16 Oct 2018 08:55:54 -0400
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,FREEMAIL_FROM,
 HTML_MESSAGE autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:58157)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <johannes.riecken@HIDDEN>)
 id 1gCOt7-0000kZ-FF
 for submit <at> debbugs.gnu.org; Tue, 16 Oct 2018 08:55:53 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:49040)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <johannes.riecken@HIDDEN>) id 1gCOt6-0002LT-NF
 for bug-coreutils@HIDDEN; Tue, 16 Oct 2018 08:55:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <johannes.riecken@HIDDEN>) id 1gCOt4-0000il-LB
 for bug-coreutils@HIDDEN; Tue, 16 Oct 2018 08:55:52 -0400
Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]:36222)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <johannes.riecken@HIDDEN>)
 id 1gCOt2-0000ee-OG
 for bug-coreutils@HIDDEN; Tue, 16 Oct 2018 08:55:49 -0400
Received: by mail-ot1-x330.google.com with SMTP id x4so20974684otg.3
 for <bug-coreutils@HIDDEN>; Tue, 16 Oct 2018 05:55:44 -0700 (PDT)
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=pDJDCO4kRTYafVc+8JOvJJH5jSq014WOWyfMOKQj5LQ=;
 b=IIoskijtr4Cm8eUca/Wwa8WsJH/fYFanYfkQxxin7slSxDgJYBueNGCpFZX9Zo4cW6
 zVp0KP6arI0AWbJh/aMp4jF21rAl8GnqArUSrbixB36s4fNyg3ZBkjlQGqEIoBPZ1l6j
 ZbQKE2y5aw2aHuarW4RdAsQYyG1EoZg1IH4MqFXPhPqCMWWfyANMzeHqQq/M6CBMxF/P
 JUuqmE7Ssig2XA+hmYSeX/0r39/+fJUsi4gDZNYmUcmjOauZQcd1hvNBFK0l0HAOdRYj
 Bh/wqnShRiiW/qREh6p3Zn13feJ/51cQikR34riPoCcKgWIAwBC/qYAl3Y/elyc8VAvw
 eaLQ==
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=pDJDCO4kRTYafVc+8JOvJJH5jSq014WOWyfMOKQj5LQ=;
 b=ilj2fzd3VDOBxHyJu8vmu2ZvGhRJRMAxKdzlmaAAKsUYujUBitSlhn1DxsDXze9Bqf
 8q2Iq2XXsW6i2/UPfIKYBEI68GWpwITLNmS4xLuVwTeIb8TwecTTwgpzVzCgSMkzNFUE
 sLuwf9P3h+qbzEOk6LmDT+CIFjalwHLReOzwuaMgPv28j006EfCdfQZwmvXz8s2PQT/1
 4l6h7PMRHBdKMfpZkH3yh5S2AzVvJ67OGSwr88Z/TycQBIt6PRMKprvwDyKGl1xh0mR3
 bFKnu3a4606nyv+/3KnT7i77lDw8wmgFDlfxVXlDC1KyA0bpcRsmVu4aAoiNE1a199Mb
 xZZA==
X-Gm-Message-State: ABuFfoh+0DEfj3gV0ups4DhFLG83j3D9Fs6th3KuX4pxWxUDAkeQZc9Q
 0+jQZjeRsgc9OJlWy0pEgGqsG3IWjMStWzcmXYRRjKDrvFE=
X-Google-Smtp-Source: ACcGV62+5RXrzS71scbYOpQMs4VQyHyHmAb4eT4ja0iICB4ch/mS9Ksp0PSKLxavk8BcvdcKqH12k7cn2vmg3zSDudA=
X-Received: by 2002:a9d:24c7:: with SMTP id z65mr13480239ota.229.1539694544018; 
 Tue, 16 Oct 2018 05:55:44 -0700 (PDT)
MIME-Version: 1.0
From: Johannes Riecken <johannes.riecken@HIDDEN>
Date: Tue, 16 Oct 2018 14:55:34 +0200
Message-ID: <CAP9p3fEApD4rQXD_tjqHt8bvbP+QxM1epDFq9S+kmTknjiQnHA@HIDDEN>
Subject: grep matches too lazily when invoked with -zoP and matching
 backreference followed by newline
To: bug-coreutils@HIDDEN
Content-Type: multipart/alternative; boundary="0000000000005be2a9057858121c"
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: Tue, 16 Oct 2018 10:41:15 -0400
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: -5.0 (-----)

--0000000000005be2a9057858121c
Content-Type: text/plain; charset="UTF-8"

Dear maintainers:

*Bug summary: *GNU grep 3.0-2 matches too lazily when invoked with -zoP and
matching backreference followed by newline

*Steps to reproduce:*

Create file cases:

foo
bar
  cases:
    1: foo
    2: bar
baz
  cases:
    3: baz
quux

And run grep -zoP '(\s*)cases:\n(\1.*\n)*' cases

*Expected output:*

  cases:
    1: foo
    2: bar
  cases:
    3: baz

* Actual output:*

  cases:

  cases:

Best regards,

Johannes Riecken

--0000000000005be2a9057858121c
Content-Type: text/html; charset="UTF-8"

<div dir="ltr"><div dir="ltr"><div>Dear maintainers:</div><div></div><div>
<p><b>Bug summary: </b>GNU grep 3.0-2 matches too lazily when invoked with -zoP and matching backreference followed by newline</p><p><b>Steps to reproduce:</b><br></p><p>Create file <code>cases</code>:</p>

<pre class="gmail-default gmail-prettyprint gmail-prettyprinted"><code><span class="gmail-pln">foo
bar
  cases</span><span class="gmail-pun">:</span><span class="gmail-pln">
    </span><span class="gmail-lit">1</span><span class="gmail-pun">:</span><span class="gmail-pln"> foo
    </span><span class="gmail-lit">2</span><span class="gmail-pun">:</span><span class="gmail-pln"> bar
baz
  cases</span><span class="gmail-pun">:</span><span class="gmail-pln">
    </span><span class="gmail-lit">3</span><span class="gmail-pun">:</span><span class="gmail-pln"> baz
quux</span></code></pre>

<p>And run<code> grep -zoP &#39;(\s*)cases:\n(\1.*\n)*&#39; cases</code> <br></p><p><b>Expected output:</b><br></p>

<pre class="gmail-default gmail-prettyprint gmail-prettyprinted"><code><span class="gmail-pln"><code><span class="gmail-pln">  cases</span><span class="gmail-pun">:</span><span class="gmail-pln">
    </span><span class="gmail-lit">1</span><span class="gmail-pun">:</span><span class="gmail-pln"> foo
    </span><span class="gmail-lit">2</span><span class="gmail-pun">:</span><span class="gmail-pln"> bar
  cases</span><span class="gmail-pun">:</span><span class="gmail-pln">
    </span><span class="gmail-lit">3</span><span class="gmail-pun">:</span><span class="gmail-pln"> baz</span></code>

</span></code></pre><b>

Actual output:</b><br><pre class="gmail-default gmail-prettyprint gmail-prettyprinted"><code><span class="gmail-pln">  cases</span><span class="gmail-pun">:</span><span class="gmail-pln">

  cases</span><span class="gmail-pun">:</span></code></pre>Best regards,</div><div><br></div><div>Johannes Riecken<br></div></div></div>

--0000000000005be2a9057858121c--




Acknowledgement sent to Johannes Riecken <johannes.riecken@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#33062; Package coreutils. 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: Thu, 2 Jan 2020 01:15:02 UTC

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