[BusyBox] [patch] Another bad sed testcase.
Rob Landley
rob at landley.net
Wed Oct 1 04:20:34 UTC 2003
"testsuite/sed/sed-requires-newline-after-edit-command" is failing, and it
boils down to:
echo "a" | sed -e 'i\foo'
-e "boo\nthing"
Which under gnu sed produces:
foo
a
While busybox produces:
\foo
a
A slightly more interesting test case is:
$ echo "a" | sed -e 'i\f\noo\' -e "boo\nthing"
fnoo
boonthing
a
$ echo "a" | ./busybox sed -e 'i\f\noo\' -e "boo\nthing"
\f\noo
boo\nthing
a
Which shows that gnu is just filtering out all backslashes in the text
argument to an append/insert/replace command. (It's not even turning \n into
a newline.) But it turns out, this is what the spec actually calls for!
The argument text shall consist of one or more lines. Each embedded <newline>
in the text shall be preceded by a backslash. Other backslashes in text shall
be removed, and the following character shall be treated literally.
Boggles the mind! (Told you I needed to finish reading the spec.) Patch
appended.
With this patch, we now produce what gnu sed does, but the testcase is still
complaining. Can we fix the testcase?
Just backrefs left to go...
Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-append.patch
Type: text/x-diff
Size: 724 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20030930/02e81043/attachment.bin
More information about the busybox
mailing list