freebsd-nq/tools/regression/usr.bin
Yaroslav Tykhiy 6b8ef68111 This trivial change should fix at least 3 similar bugs. All of
them are related to the `c' function's need to know if we are at
the actual end of the address range.  (It must print the text not
earlier than the whole pattern space was deleted.)  It appears the
only sed function with this requirement.

There is `lastaddr' set by applies(), which is to notify the `c'
function, but it can't always help because it's false when we are
hitting the end of file early.  There is also a bug in applies()
due to which `lastaddr' isn't set to true on degenerate ranges such
as `$,$' or `N,$' if N appears the last line number.

Handling early EOF condition in applies() could look more logical,
but it would effectively revert sed to the unreasonable behaviour
rev. 1.26 of main.c fought against, as it would require lastline()
be called for each line within each address range.  So it's better
to call lastline() only if needed by the `c' function.

Together with this change to sed go regression tests for the bugs
fixed (c1-c3).  A basic test of `c' (c0) is also added as it helped
me to spot my own error.

Discussed with:		dds
Tested by:		the regression tests
MFC after:		1 week
2007-04-01 13:25:03 +00:00
..
env Correct one regression test (which was expected an incorrect answer), and 2005-07-15 02:31:15 +00:00
file2c o -n option added. 2005-05-15 07:35:34 +00:00
join Switch over to a different, more flexible test output protocol that's 2004-11-11 19:47:55 +00:00
jot New test cases demonstrating fixed bugs, and the reason why 2006-12-03 19:18:41 +00:00
m4 Switch over to a different, more flexible test output protocol that's 2004-11-11 19:47:55 +00:00
make Add first tests for semicolon handling. The first test fails. This is 2005-10-18 07:28:09 +00:00
pkill Fix and extend the -j option to pkill/pgrep WRT the jail 2006-11-23 11:55:17 +00:00
printf Also test \0 in the format string. 2005-04-14 18:33:14 +00:00
sed This trivial change should fix at least 3 similar bugs. All of 2007-04-01 13:25:03 +00:00
uudecode Switch over to a different, more flexible test output protocol that's 2004-11-11 19:47:55 +00:00
uuencode Switch over to a different, more flexible test output protocol that's 2004-11-11 19:47:55 +00:00
xargs Switch over to a different, more flexible test output protocol that's 2004-11-11 19:47:55 +00:00
Makefile Add a few regression tests for printf(1). 2005-04-13 20:08:17 +00:00
regress.m4 Switch over to a different, more flexible test output protocol that's 2004-11-11 19:47:55 +00:00