[PATCH] for review Re: Sed substitution bugs

Harti Brandt brandt at fokus.fraunhofer.de
Wed Jun 4 09:08:15 PDT 2003


On Wed, 4 Jun 2003, Tony Finch wrote:

TF>On Wed, Jun 04, 2003 at 10:46:36AM -0500, Juli Mallett wrote:
TF>>
TF>> We seem to bounce back and forth on what exactly counts as passing
TF>> that test..  Tell ya what, run it against SysV or GNU sed, and patch
TF>> using the diffs.
TF>
TF>Solaris:
TF>$ echo -n foo | sed y/o/O/
TF>sed: Missing newline at end of file standard input.
TF>fOO
TF>$
TF>
TF>GNU:
TF>$ echo -n foo | sed y/o/O/
TF>fOO$
TF>
TF>GNU is clearly the right implementation, and it's what the regression
TF>test says sed should do. I think sed should be fixed. (I can't do it
TF>right now because I'm going climbing.)

Either way is correct since, according to posix, sed works only on text
files and a file containing the three characters 'f' 'o' 'o' is not a text
file. That said, I think, the GNU variant is the more sane 'unspecified'
behaviour.

harti
-- 
harti brandt,
http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private
brandt at fokus.fraunhofer.de, harti at freebsd.org


More information about the freebsd-standards mailing list