hush/editors
Rob Landley dcc286607c 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
2004-11-25 07:21:47 +00:00
..
awk.c Patch from Dmitry Zakharov to fix a bug triggered by freeswan's scripts. 2004-09-24 09:24:27 +00:00
Config.in Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
Makefile egor duda writes: 2004-10-08 07:46:08 +00:00
Makefile.in egor duda writes: 2004-10-08 07:46:08 +00:00
patch.c Update my email address, document some of my tasks in the AUTHORS file 2004-04-25 05:11:19 +00:00
sed.c Hiroshi found another bug. Currently sed's $ triggers at end of every file, 2004-11-25 07:21:47 +00:00
vi.c regularly update the status line display 2004-08-19 19:15:06 +00:00