Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Jun 2003 12:44:22 +1000
From:      Tim Robbins <tjr@FreeBSD.org>
To:        Tony Finch <dot@dotat.at>
Cc:        Mike Barcroft <mike@FreeBSD.org>
Subject:   Re: [PATCH] for review Re: Sed substitution bugs
Message-ID:  <20030605124421.A82856@dilbert.robbins.dropbear.id.au>
In-Reply-To: <20030604155534.GQ18938@chiark.greenend.org.uk>; from dot@dotat.at on Wed, Jun 04, 2003 at 04:55:34PM %2B0100
References:  <20030603144225.GH18938@chiark.greenend.org.uk> <20030603151925.GI18938@chiark.greenend.org.uk> <20030603211357.B70533@espresso.bsdmike.org> <20030604151553.GO18938@chiark.greenend.org.uk> <20030604104636.A88028@FreeBSD.org> <20030604155534.GQ18938@chiark.greenend.org.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jun 04, 2003 at 04:55:34PM +0100, Tony Finch wrote:

> Solaris:
> $ echo -n foo | sed y/o/O/  
> sed: Missing newline at end of file standard input.
> fOO
> $
> 
> GNU:
> $ echo -n foo | sed y/o/O/  
> fOO$
> 
> GNU is clearly the right implementation, and it's what the regression
> test says sed should do. I think sed should be fixed. (I can't do it
> right now because I'm going climbing.)

Your input is malformed. Making sed not store the newlines made it easier to
fix a whole bunch of bugs, but made it harder to deal with this kind of
malformed input in the traditional (for BSD) way. See sed/process.c rev. 1.21
and the PR's it mentions.

Warning about missing newlines like Solaris sed does is probably a good idea;
I'll see if I can do that. But I don't consider following the traditional
BSD behaviour of not adding missing newlines to be a high priority.


Tim



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030605124421.A82856>