freebsd-nq/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
..
alias
apply It's `apply echo *'' that is similar to ls -1'', not `apply echo a*''. 2006-12-13 08:13:14 +00:00
asa
at
atm
awk Fix a bug converting a variable from the numeric type to a string. 2006-10-25 21:23:20 +00:00
banner o Check that -w width is not above maximum. Use DWIDTH instead of 2006-11-22 21:05:17 +00:00
basename
biff Fix markup. 2006-12-28 04:58:38 +00:00
bluetooth Add "server mode" to rfcomm_sppd(1). 2007-01-25 20:54:59 +00:00
brandelf Fix markup. 2007-03-09 14:36:18 +00:00
bsdiff Portability fix for non-POSIX operating systems: Open files in binary mode. 2006-12-05 20:22:14 +00:00
bzip2 Update for bzip2 1.0.4 import. 2007-03-28 07:48:03 +00:00
bzip2recover
c89 Reduce diffs with c99(1). 2007-03-10 07:10:01 +00:00
c99 Bump the original revision of c89(1). 2007-03-10 07:11:20 +00:00
calendar Add myself. 2007-03-11 06:44:37 +00:00
cap_mkdb
catman
chat
checknr
chkey
chpass
cksum
cmp Refine markup and add the EXIT STATUS section where appropriate. 2006-12-19 10:34:14 +00:00
col
colcrt
colldef
colrm
column Fix the fix in rev. 1.15 so that we jump to the next column 2006-12-15 17:47:25 +00:00
comm
compile_et
compress
csplit
csup
ctags cleanup code: remove unnecessary and useless void cast 2007-02-04 20:07:07 +00:00
cut - Adopt the short description from POSIX as it better matches the 2007-02-28 10:13:32 +00:00
dig
dirname
du
ee
elf2aout
elfdump
enigma Markup nits. 2006-12-24 19:55:38 +00:00
env
expand Document that unexpand(1)'s -a and -t options are exclusive. 2006-10-13 16:22:25 +00:00
false
fetch Try to preserve ownership and permissions when replacing an existing file. 2006-11-10 22:05:41 +00:00
file
file2c Add '-s' option and update the manual page. With this option, it prints 2007-03-23 00:00:22 +00:00
find Check in some insignificant fixes obtained as a result of 2007-02-28 10:19:25 +00:00
finger
fmt
fold Mention what underlining is meant here. 2006-12-15 11:23:59 +00:00
from Improve markup. 2006-12-18 15:36:31 +00:00
fstat KERN_PROC_ALL produces a kinfo_proc for each thread in a process, which 2007-03-09 16:21:40 +00:00
fsync
ftp
gcore
gencat
getconf o confstr(3) returns 0 on error. Check the return value accordingly. 2006-12-06 12:00:26 +00:00
getent cleanup code: remove superfluous comma at end of enumeration 2007-02-04 20:52:57 +00:00
getopt
gprof
gzip Mention a limitation that was inherted from RFC1952, making 2007-03-16 03:50:53 +00:00
head Fix build on architectures where off_t is signed by casting to uintmax_t 2007-01-11 20:23:01 +00:00
hesinfo
hexdump Document the -d option. 2006-12-24 14:23:35 +00:00
host
id Fix SUSv3 compliance: Use a single comma instead of comma and space to separate 2006-12-29 12:28:34 +00:00
indent
ipcrm Spell "id" as "ID". 2007-03-09 12:45:00 +00:00
ipcs
join Improve markup and do some minor wordsmithing. 2006-12-21 10:59:48 +00:00
jot Use explicit braces to avoid ambiguous else. 2006-12-09 15:23:20 +00:00
kdump Add various utrace's for use with ktrace to the ELF runtime linker. To 2007-01-09 17:50:05 +00:00
keylogin
keylogout
killall
ktrace Allow the -c -f file options to actually execute. 2007-02-13 00:22:29 +00:00
ktrdump
lam Document that jot(1), rs(1), and lam(1) first appeared in 4.2BSD. 2006-10-20 04:31:01 +00:00
last
lastcomm
ldd
leave
less
lessecho
lesskey
lex
limits
locale
locate
lock
lockf Markup cosmetics. 2006-12-20 16:57:13 +00:00
logger
login Teach login(1) about the make.conf NO_AUDIT variable. This allows us to 2006-12-13 06:13:32 +00:00
logins
logname Say "utility", not "function". 2006-12-26 10:37:37 +00:00
look
lorder Document the NM environment variable. 2006-10-25 09:40:07 +00:00
lsvfs
m4
mail o Really commit typo fixes to HEAD. 2007-03-25 18:37:59 +00:00
make Better English. 2007-03-08 14:05:45 +00:00
makewhatis
mesg
minigzip
ministat
mkdep
mkfifo Fix markup. 2006-12-15 14:14:17 +00:00
mklocale getopt(3) returns -1, not EOF. 2007-02-06 08:48:28 +00:00
mkstr More markup fixes. 2007-03-04 08:24:13 +00:00
mktemp
mkuzip Support character device as input file. 2007-03-06 17:04:15 +00:00
msgs
mt
nc
ncal
ncplist getopt(3) returns -1, not EOF when out of args. 2007-02-05 07:35:23 +00:00
ncplogin getopt(3) returns -1, not EOF when out of args. 2007-02-05 07:35:23 +00:00
netstat Fixing NO_INET6 build as addr2ascii() has been nuked in previous commit. 2007-03-02 05:23:39 +00:00
newgrp
newkey
nfsstat Fix markup. 2006-12-25 20:30:10 +00:00
nice
nl o Really commit typo fixes to HEAD. 2007-03-25 18:37:59 +00:00
nohup
nslookup Fix the problem with the nsupdate(8) man page reported 2006-12-15 18:02:20 +00:00
nsupdate Fix the problem with the nsupdate(8) man page reported 2006-12-15 18:02:20 +00:00
objformat Bah. Kris says the default-to-a.out knowledge has migrated into the 2007-01-25 23:12:19 +00:00
opieinfo
opiekey
opiepasswd
pagesize
passwd
paste
pathchk
pkill Be more accurate in the description of the -I option: 2006-12-20 11:57:22 +00:00
pr
printenv Simplify. 2006-12-26 12:43:12 +00:00
printf
quota Fix some spelling / markup / grammar. 2007-02-11 18:13:00 +00:00
renice
rev
rlogin
rpcgen
rpcinfo
rs Document that jot(1), rs(1), and lam(1) first appeared in 4.2BSD. 2006-10-20 04:31:01 +00:00
rsh
rup Backport markup fixes from a translated version of a manpage. 2007-02-28 10:22:19 +00:00
ruptime
rusers
rwall
rwho
script
sed This trivial change should fix at least 3 similar bugs. All of 2007-04-01 13:25:03 +00:00
setchannel Add support for selecting from multiple tuners. 2007-02-25 01:28:37 +00:00
shar
showmount
smbutil
sockstat Use proc name (ki_comm) instead of thread name (ki_ocomm) as these may now 2007-03-22 17:47:58 +00:00
split
stat
su Backout previous change (SIGSYS related). The fix has been applied to the 2006-10-24 17:41:28 +00:00
systat Fix definitions of kilobits etc. 2007-01-18 09:24:08 +00:00
tabs
tail Markup revision. 2006-12-24 19:18:52 +00:00
talk
tar Add tests for "bsdtar -t". These are useful primarily because they test 2007-03-31 22:04:36 +00:00
tcopy Document some details better, making it easier to translate. 2006-12-20 15:34:01 +00:00
tee
telnet
tftp
time
tip Make cu/tip handle when $HOME is not set in the environment. 2007-02-23 18:41:12 +00:00
top The sigconv.awk script generates a sigdesc.h header file, which 2006-12-01 07:01:19 +00:00
touch
tput At least one argument is required. 2006-10-12 21:10:55 +00:00
tr o Remove duplicate includes. 2007-01-20 08:24:02 +00:00
true
truncate The -r option can also cause the files to be extended (not 2006-12-19 11:20:34 +00:00
truss Add missing markup bits. 2006-12-11 11:34:44 +00:00
tset
tsort - Remove the ambiguity in the input format description. 2006-12-27 14:56:18 +00:00
tty Fix markup nits, add the EXIT STATUS section. 2006-12-13 20:15:49 +00:00
ul Fix markup. 2007-02-27 12:06:02 +00:00
uname
unexpand Document that unexpand(1)'s -a and -t options are exclusive. 2006-10-13 16:22:25 +00:00
unifdef
uniq Document that uniq(1) limits input line length to LINE_MAX characters. 2007-01-15 23:25:51 +00:00
units
unvis
usbhidaction
usbhidctl Bump document date. 2006-11-23 05:08:06 +00:00
users
uudecode
uuencode
uuidgen
vacation
vgrind
vi
vis Nits. 2006-12-23 19:15:39 +00:00
vmstat - Revert signedness type changes to "struct vmtotal"; by making 2006-11-28 12:46:02 +00:00
w Fix markup. 2006-12-14 19:02:48 +00:00
wall
wc Prevent a line from being broken on a line boundary. 2006-12-21 22:59:07 +00:00
what Polish markup and wording. 2006-12-14 00:02:44 +00:00
whereis
which Refine the previous revision. 2006-12-13 12:09:41 +00:00
who
whois Make DK-HOSTMASTER show contact info for .dk domains. 2007-01-19 08:13:17 +00:00
window
write
xargs
xinstall
xlint Fix a group of typos: 2006-12-29 13:08:46 +00:00
xstr
yacc
yes
ypcat
ypmatch
ypwhich Fix markup nit. 2006-12-28 10:58:06 +00:00
Makefile Replace the GNU gzip with a slightly modified NetBSD gzip. The 2007-01-26 10:19:08 +00:00
Makefile.inc