bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#12903: "cut -b 0-" is supposed to be invalid


From: Jim Meyering
Subject: bug#12903: "cut -b 0-" is supposed to be invalid
Date: Mon, 19 Nov 2012 02:05:11 +0100

Bernhard Voelker wrote:
> On 11/16/2012 11:23 PM, Jim Meyering wrote:
>> Bernhard Voelker wrote:
>>
>>> Hi Marcel,
>>>
>>> On 11/16/2012 07:35 AM, Marcel Böhme wrote:
>>>>    Hi,
>>>>    The command "echo 12345 | cut -b 0-" prints an empty line while it
>>>>    should fail with "fields and positions are numbered from 1" according
>>>>    to this specification "cut: diagnose a range starting with 0 (-f 0-2)
>>>>    as invalid".
>>>>    Can you confirm this is an incomplete bugfix made on 2007-05-22?
>>>
>>> I'd say yes.
>>> Here's a proposed fix.
>> ...
>
>> Thank you!
>> That change looks fine, at first glance,
>> but please amend the log to mention the bug number URL.
>> Also, technically this is a bug, so please mention the
>> fix in NEWS.
>
> Thanks for the review.
>
> I amended with updated NEWS and also improved the test to include
> both the field option -f and the position options -b and -c,
> plus mentioned the bug URL in the commit message.
>
> Have a nice day,
> Berny
>
>
>>From 10fc244ac8e4f24eb330eae110fadc0b7d78cf8d Mon Sep 17 00:00:00 2001
> From: Bernhard Voelker <address@hidden>
> Date: Sun, 18 Nov 2012 22:20:16 +0100
> Subject: [PATCH] cut: do not accept the invalid range 0-
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> The command "echo 12345 | cut -b 0-" prints an empty line while
> it should fail with "fields and positions are numbered from 1".
>
> * src/cut.c (set_fields): Add a diagnostic for the invalid open
> range which starts with Zero, i.e., the range 0-.
> * tests/misc/cut.pl: Add tests to ensure the range 0- fails for
> fields (-f) and for positions (-b, -c).
> * NEWS: Mention the fix.
>
> Reported by Marcel Böhme in <http://bugs.gnu.org/12903>.

Looks perfect, now.  You're welcome to push it.
Thanks!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]