GNU bug report logs - #21250
sed: empty label for :/b/t commands

Previous Next

Package: sed;

Reported by: Stephane Chazelas <stephane.chazelas <at> gmail.com>

Date: Thu, 13 Aug 2015 14:39:01 UTC

Severity: normal

Tags: fixed

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jim Meyering <jim <at> meyering.net>
To: Stephane Chazelas <stephane.chazelas <at> gmail.com>
Cc: 21250 <at> debbugs.gnu.org
Subject: bug#21250: sed: empty label for :/b/t commands
Date: Sun, 23 Aug 2015 21:54:30 -0700
[Message part 1 (text/plain, inline)]
On Sun, Aug 23, 2015 at 5:08 AM, Stephane Chazelas
<stephane.chazelas <at> gmail.com> wrote:
> 2015-08-22 22:02:42 -0700, Jim Meyering:
> [...]
>> I am preparing a patch to remove that functionality, making sed do
>> this, instead:
>>
>>   $ sed :
>>   sed: -e expression #1, char 1: ":" lacks a label
>>
>> Does anyone feel differently?
>> However, note that I have not surveyed other sed implementations.
> [...]
>
> Thanks.
>
> Solaris 11 (/bin/sed or /usr/xpg4/bin/sed):
>
> $ echo aa | sed -e : -e s/a/b/ -e t
> ba
>
> (it doesn't complain on :, but t branches to the end, not to
> that empty label).
>
> Same with busybox sed.
>
> With FreeBSD sed:
>
> $ echo aa | sed -e : -e s/a/b/ -e t
> sed: 1: ":
> ": empty label
>
> (exit status: 1)

Thanks for checking those.
Here's the patch I expect to push tomorrow:
[0001-sed-reject-a-command-without-a-label.patch (text/x-patch, attachment)]

This bug report was last modified 8 years and 173 days ago.

Previous Next


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