[PATCH] for review Re: Sed substitution bugs

Tim Robbins tjr at FreeBSD.org
Wed Jun 4 19:47:40 PDT 2003


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


More information about the freebsd-standards mailing list