freebsd-dev/tools/regression/usr.bin/sed
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
..
regress.multitest.out Reinstate error-testing regression tests. 2007-03-14 13:38:23 +00:00
hanoi.sed
Makefile Rename sed.test to multitest.t to comply with the naming scheme of 2007-03-14 18:58:59 +00:00
math.sed A new version that does exponents and lots of other neat things. Update 2004-05-01 02:15:58 +00:00
multitest.t Reinstate error-testing regression tests. 2007-03-14 13:38:23 +00:00
regress.bcb.out
regress.c0.out This trivial change should fix at least 3 similar bugs. All of 2007-04-01 13:25:03 +00:00
regress.c1.out This trivial change should fix at least 3 similar bugs. All of 2007-04-01 13:25:03 +00:00
regress.c2.out This trivial change should fix at least 3 similar bugs. All of 2007-04-01 13:25:03 +00:00
regress.c3.out This trivial change should fix at least 3 similar bugs. All of 2007-04-01 13:25:03 +00:00
regress.G.out
regress.hanoi.out Add Towers of Hanoi regression test. 2007-03-14 07:52:38 +00:00
regress.in
regress.math.out Add sed math regression test. 2007-03-14 07:55:05 +00:00
regress.P.out
regress.psl.out
regress.s3.out
regress.s4.out
regress.s5.out
regress.sg.out
regress.sh This trivial change should fix at least 3 similar bugs. All of 2007-04-01 13:25:03 +00:00
regress.t Switch over to a different, more flexible test output protocol that's 2004-11-11 19:47:55 +00:00
regress.y.out Add missing newline to correct failure of the regression test. 2007-03-14 07:01:49 +00:00