diff options
author | Rob Landley <rob@landley.net> | 2004-11-25 07:21:47 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2004-11-25 07:21:47 +0000 |
commit | dcc286607c83723f2b05f91da0a6942999576106 (patch) | |
tree | e3c4b321b130d28af36ff5cf3bdc48771a405ba2 /sysdeps | |
parent | a8b98d63e76177dfc6aa1d5647783da200034b3d (diff) | |
download | busybox-dcc286607c83723f2b05f91da0a6942999576106.tar.gz |
Hiroshi found another bug. Currently sed's $ triggers at end of every file,
and with multiple files SuSv3 says it should only trigger at the end of the
LAST file.
The trivial fix I tried first broke if the last file is empty. Fixing this
properly required restructuring things to create a file list (actually a
FILE * list), and then processing it all in one go. (There's probably a
smaller way to do this, merging with append_list perhaps. But let's get
the behavior correct first.)
Note that editing files in place (-i) needs the _old_ behavior, with $
triggering at the end of each file.
Here's a test of all the things this patch fixed. gnu and busybox seds produce
the same results with this patch, and different without it.
echo -n -e "1one\n1two\n1three" > ../test1
echo -n > ../test2
echo -e "3one\n3two\n3three" > ../test3
sed -n "$ p" ../test1 ../test2 ../test3
sed -n "$ p" ../test1 ../test2
sed -i -n "$ p" ../test1 ../test2 ../test3
Diffstat (limited to 'sysdeps')
0 files changed, 0 insertions, 0 deletions