NetBSD/usr.bin
martin 0e1a0b92e0 Pull up following revision(s) (requested by kre in ticket #1020):
usr.bin/printf/printf.c: revision 1.46

A truly ancient bug found by Edgar Fuss

When printf is running builtin in a sh, global vars aren't reset to
0 between invocations.   This affects "rval" which remembers state
from a previous %b \c and thereafter always exits after the first
format conversion, until we get a conversion that generates an
error (which resets the flag almost by accident)

	printf %b abc\\c
	abc				(no \n)
	printf %s%s hello world
	hello				(no \n, of course, no world ...)
	printf %s%s hello world
	hello
	printf %s%s hello world
	hello
	printf %d hello
	printf: hello: expected numeric value
	0				(no \n)
	printf %s%s hello world
	helloworld			(no \n, and we are back!)

This affects both /bin/sh and /bin/csh (and has for a very long time).

XXX pullup -8
2018-09-23 17:16:33 +00:00
..
apply Be more precise. 2016-03-14 09:53:37 +00:00
apropos
asa Drop main() prototype. 2016-09-05 00:40:28 +00:00
at Oops, it should be Aq Mt email@address 2016-11-18 12:16:48 +00:00
audio Pull up following revision(s) (requested by jdolecek in ticket #395): 2017-11-27 12:00:37 +00:00
audiocfg if opening the audio device fails, try opening again with write-only. 2016-03-05 22:10:39 +00:00
banner Sync usage with man page. From Bug Hunting in PR 46102. 2012-02-29 08:55:25 +00:00
basename Use __dead 2011-08-29 14:24:03 +00:00
bdes PR/50739: David Binderman: Check bounds before dereferencing. 2016-02-01 17:41:37 +00:00
biff Update SYNOPSIS to reflect that y and n options are mutually exclusive. 2016-12-20 08:21:32 +00:00
bthset use correct offset for channel in SDP record 2016-03-06 21:12:07 +00:00
btkey Sort sections. From Henning Petersen in PR 49222. 2014-09-19 16:02:58 +00:00
btpin Sort sections. From Henning Petersen in PR 49222. 2014-09-19 16:02:58 +00:00
bzip2 Adapt to repository move of dist from external/bsd/bzip2 to 2012-05-07 08:51:47 +00:00
bzip2recover Adapt to repository move of dist from external/bsd/bzip2 to 2012-05-07 08:51:47 +00:00
c11 Minor improvements, add more markup. 2016-10-03 08:20:12 +00:00
c89 this are our's not gnu 2016-01-14 04:27:26 +00:00
c99 this are our's not gnu 2016-01-14 04:27:26 +00:00
cal fix some error handling. 2015-06-16 22:54:10 +00:00
calendar Pull up following revision(s) (requested by jnemeth in ticket #908): 2018-07-13 14:35:55 +00:00
cap_mkdb Change some standard exit status text to ".Ex -std" 2014-04-13 01:45:34 +00:00
cdplay more stray \n 2015-06-17 00:01:59 +00:00
checknr Add more __dead. 2013-08-12 14:03:18 +00:00
chflags In all man pages that say: 2013-12-17 09:54:08 +00:00
chpass Fixed memory leak (CID 978341) 2015-10-27 14:47:45 +00:00
cksum fix some error handling. 2015-06-16 22:54:10 +00:00
cleantags Move .Op macro to its own line. Fix SYNOPSIS rendering with mandoc. 2013-04-26 17:12:10 +00:00
cmp Add a HISTORY section 2016-12-14 15:24:06 +00:00
col PR/49291: Henning Petersen: Problem with half-line feeds in input stream. 2014-10-18 14:56:14 +00:00
colcrt Change or add history. I checked the 1bsd archives and this first 2012-05-12 14:52:57 +00:00
colrm Change or add history. I checked the 1bsd archives and this first 2012-05-12 14:52:57 +00:00
column Move information about exit values from DESCRIPTION to EXIT STATUS section. 2016-10-02 21:06:18 +00:00
comm Change some standard exit status text to ".Ex -std" 2014-04-13 01:45:34 +00:00
compress Use __printflike and __dead 2011-08-30 23:08:05 +00:00
config Pull up following revision(s) (requested by jmcneill in ticket #114): 2017-07-18 19:13:07 +00:00
crunch Don't make crunch binaries PIE 2016-05-29 16:12:58 +00:00
csplit Correct number of output files in example. 2014-02-04 19:48:48 +00:00
ctags Change some standard exit status text to ".Ex -std" 2014-04-13 01:45:34 +00:00
cut From Igor Sobrado in private email (based on his OpenBSD commit): 2014-02-03 20:22:19 +00:00
cvslatest give the absolute path for the error message. 2017-01-12 14:27:14 +00:00
db Fix typo. Bump date for previous. 2012-02-17 11:43:24 +00:00
dc Remove MKCRYPTO option. 2017-05-21 15:28:36 +00:00
deroff fix unused variable warnings 2013-10-18 20:47:06 +00:00
dirname Use __dead 2011-09-16 15:39:25 +00:00
du Add EXIT STATUS section and bump date. 2012-05-14 21:14:14 +00:00
eject Drop main() prototype. 2016-09-05 00:40:28 +00:00
elf2aout Gcc, please shut up with those stupid warnings! 2016-03-07 22:16:38 +00:00
elf2ecoff fix printf format 2017-02-24 17:19:14 +00:00
env minor KNF nits. 2010-11-16 02:53:49 +00:00
error PR 51298 David Binderman: simplify redundant conditionals 2016-06-30 15:34:30 +00:00
expand Drop main() prototype. 2016-09-05 00:40:28 +00:00
extattr Use returned size and not buffer max length when displaying attribute 2014-06-20 15:22:01 +00:00
false
fdformat Drop main() prototype. 2016-09-05 00:40:28 +00:00
fgen Unbreak tools build. 2016-03-10 11:32:10 +00:00
fincore SEE ALSO and CAVEATS 2012-01-04 16:18:11 +00:00
find Pull up following revision(s) (requested by kre in ticket #1016): 2018-09-10 15:48:25 +00:00
finger Instead of saying "The finger displays information..." say "The finger utility" 2016-12-22 12:39:40 +00:00
flock mention that -x is the default. 2014-08-18 09:45:52 +00:00
fmt add -w as an alias to -m 2012-06-30 21:31:15 +00:00
fold Remove trailing whitespace. 2012-05-12 15:17:15 +00:00
fpr Fix whitespace nits. Suggested by Bug Hunting. 2012-03-22 07:58:16 +00:00
from
fsplit fix some error handling. 2015-06-16 22:54:10 +00:00
fstat Pull up following revision(s) (requested by nat in ticket #873): 2018-06-09 15:41:37 +00:00
ftp Remove MKCRYPTO option. 2017-05-21 15:28:36 +00:00
gcore Remove the BUGS section from gcore(1) - issues are no longer relevant 2017-03-26 22:00:04 +00:00
genassym - use just the basename for program name 2014-01-06 22:43:15 +00:00
gencat Use LIST_FOREACH, LIST_NEXT, etc., instead of direct access to 2013-11-27 17:38:11 +00:00
getaddrinfo need bsd.own.mk 2014-04-29 01:21:02 +00:00
getconf Change some standard exit status text to ".Ex -std" 2014-04-13 01:45:34 +00:00
getent Add __printflike attribution to use vprintf and friends with an argument 2012-03-15 02:02:20 +00:00
getopt
gettext From William Orr: 2015-07-12 11:40:52 +00:00
gprof Reorg docs, part 1: 2014-07-05 19:22:41 +00:00
grep fix type, from enh at google dot com 2014-07-14 21:56:03 +00:00
gzip update copyright strings. 2017-06-03 21:28:48 +00:00
head If the negative number is passed to option '-c' or '-n', 2016-05-12 01:56:44 +00:00
hesinfo Drop main() prototype. 2016-09-05 00:40:28 +00:00
hexdump Don't try to use stdin after clobbering it with a failed freopen(). 2016-03-04 03:02:52 +00:00
iconv Save errno around fwrite(), which can otherwise trash it; PR 47813. 2013-10-07 02:00:46 +00:00
id Move information about exit values from DESCRIPTION to EXIT STATUS section. 2016-10-02 21:06:18 +00:00
indent Drop main() prototype. 2016-09-05 00:40:28 +00:00
infocmp _ti_database now includes the database extension so don't duplicate it. 2017-05-16 09:21:54 +00:00
innetgr simplify __dead usage 2016-09-03 05:50:06 +00:00
ipcrm
ipcs Remove KVM support. 2014-06-11 14:57:55 +00:00
join Remove unnecessary Bk/Ek pairs from SYNOPSIS. 2012-04-08 22:00:37 +00:00
jot Bump date for previous 2016-01-04 23:55:36 +00:00
kdump Drop main() prototype. 2016-09-05 00:40:28 +00:00
klist
ktrace Omit no longer existing l, m from default trace points. 2015-01-08 22:03:42 +00:00
ktruss Define _KERNTYPES for things that need it. 2016-01-23 21:22:45 +00:00
lam Bump date for previous 2016-01-04 23:55:36 +00:00
last Change or add history. I checked the 1bsd archives and this first 2012-05-12 14:52:57 +00:00
lastcomm Sync usage with man page. 2012-01-31 21:53:42 +00:00
ldd need <sys/stat.h> 2017-01-10 21:08:48 +00:00
leave Now that window(1) is gone, use tmux(1) for xref. 2012-02-21 15:01:51 +00:00
locale Remove code for CITRUS!=yes. 2012-01-20 16:31:29 +00:00
locate Drop main() prototype. 2016-09-05 00:40:28 +00:00
lock Drop main() prototype. 2016-09-05 00:40:28 +00:00
logger Small typo in macro. 2012-05-13 17:08:31 +00:00
login - Added error checks for initgroups(3) and setgroups(2). 2015-10-29 11:31:52 +00:00
logname ANSIfy + static + __dead 2011-09-04 20:29:12 +00:00
look Properly check mmap(2) return value. We can end up with a segmentation 2017-02-21 09:23:31 +00:00
lorder Fix whitespace nits. Suggested by Bug Hunting. 2012-03-22 07:58:16 +00:00
m4 Pull up following revision(s) (requested by kre in ticket #956): 2018-08-07 13:11:12 +00:00
machine
mail reset signal handler before returning. 2017-05-02 03:29:14 +00:00
make Pull up following revision(s) (requested by christos in ticket #870): 2018-06-09 15:35:37 +00:00
man Teach man -p to respect the MANPATH environment variable and the -M option. 2017-05-02 14:19:23 +00:00
menuc avoid redefinitions 2013-10-18 20:19:36 +00:00
mesg
midiplay Pull up following revision(s) (requested by mrg in ticket #820): 2018-05-12 10:40:25 +00:00
midirecord avoid assert() and simply return errors. 2017-06-03 21:31:14 +00:00
mixerctl Generate usage error for bad usage, before attempting any other operations. 2017-02-23 14:09:11 +00:00
mkcsmapper Infile is also optional. 2016-06-28 09:23:09 +00:00
mkdep fix some error handling. 2015-06-16 22:54:10 +00:00
mkesdb Sync usage with program. Add RCS Id. Increase column width. Fix macro usage. Improve wording. 2016-06-28 09:25:21 +00:00
mkfifo ANSIfy + static + __dead 2011-09-04 20:29:12 +00:00
mklocale __dead should come first; also remove more K&Risms. 2016-09-03 05:56:59 +00:00
mkstr Drop main() prototype. 2016-09-05 00:40:28 +00:00
mktemp minor wording nits and a typo fix 2014-11-10 07:33:31 +00:00
mkubootimage Pull up following revision(s) (requested by jmcneill in ticket #347): 2017-11-06 09:52:15 +00:00
moduli Remove MKCRYPTO option. 2017-05-21 15:28:36 +00:00
msgc avoid redefinitions 2013-10-18 20:19:36 +00:00
msgs Drop main() prototype. 2016-09-05 00:40:28 +00:00
nbperf Most CPUs implement shifts modulo the width, but ARM doesn't. Don't 2014-04-30 21:04:58 +00:00
nbsvtool New sentence, new line. 2011-04-28 17:14:45 +00:00
nc Remove MKCRYPTO option. 2017-05-21 15:28:36 +00:00
netgroup simplify __dead usage 2016-09-03 05:58:30 +00:00
netstat Pull up following revision(s) (requested by msaitoh in ticket #939): 2018-07-26 23:43:31 +00:00
newgrp Add USE_FORT support. 2016-07-13 13:10:04 +00:00
newsyslog Revert previous, it was wrong. 2013-12-20 17:01:39 +00:00
nfsstat PR/48426: Dimitris Karagkasidis: Make nfsstat use unsigned numbers. 2014-04-24 18:40:35 +00:00
nice Fix whitespace nits. Suggested by Bug Hunting. 2012-03-22 07:58:16 +00:00
nl Improve description. 2013-09-24 22:08:06 +00:00
nohup Punctuation. 2012-03-29 18:33:19 +00:00
pagesize
passwd add sqlite3 2017-01-28 23:42:36 +00:00
paste Remove second NetBSD RCS Id. 2013-04-07 17:43:01 +00:00
patch Pull up following revision(s) (requested by christos in ticket #699): 2018-04-08 06:04:08 +00:00
pathchk Use __dead 2011-09-16 15:39:25 +00:00
pkill PR bin/50934 -- avoid core dump if a process being examined has set 2017-02-21 13:09:56 +00:00
pmap for 64 bit mips platforms where we built userland largely as n32 by 2016-12-23 10:19:57 +00:00
pmc Pull up following revision(s) (requested by maxv in ticket #164): 2017-08-01 23:18:30 +00:00
pr - Fix optional argument options (e, i, n, s) in SYNOPSIS and DESCRIPTION 2012-08-01 02:36:17 +00:00
printenv static + __dead 2011-09-06 18:26:55 +00:00
printf Pull up following revision(s) (requested by kre in ticket #1020): 2018-09-23 17:16:33 +00:00
progress Retry read() on EINTR. Fixes premature exit of 2015-01-17 10:57:51 +00:00
pwait add flag that let's you not wait for all the processes specified. 2015-03-04 16:36:12 +00:00
pwhash md5 is a hashing algorithm, don't say it is used for encryption. 2016-05-24 06:15:43 +00:00
qsubst Use Nm to refer the program name. 2017-02-22 14:01:40 +00:00
quota Remove leftover #if 0 code from before the libquota rework. 2014-07-13 01:46:04 +00:00
radioctl static + __dead 2011-09-06 18:26:55 +00:00
rdist more clobbering fixes. 2013-10-18 20:43:45 +00:00
renice emove duplicate RCS Id. Bump date for previous. 2012-12-06 07:52:12 +00:00
rev Use __dead 2011-09-16 15:39:25 +00:00
revoke
rfcomm_sppd need <sys/stat.h> 2017-01-10 21:08:48 +00:00
rlogin Added missing sa_mask initialization (CID 979636) 2015-10-28 08:15:53 +00:00
rpcgen u_int -> unsigned int, in some of the output. 2016-01-23 02:33:09 +00:00
rpcinfo passes WARNS=5, don't set it to 4. 2013-08-21 21:05:29 +00:00
rs Bump date for previous 2016-01-04 23:55:36 +00:00
rsh Changes done in rsh.c rev. 1.36 was incomplete. As chuq pointed 2014-11-26 23:44:21 +00:00
rump_allserver With the removal of HAVE_REGISTER_T from rumpuser_port.h, _KERNTYPES does not 2017-05-11 04:33:14 +00:00
rump_dhcpclient Remove more _KERNTYPES definitions in rump components. 2017-05-11 13:20:02 +00:00
rump_halt Remove more _KERNTYPES definitions in rump components. 2017-05-11 13:20:02 +00:00
rump_server With the removal of HAVE_REGISTER_T from rumpuser_port.h, _KERNTYPES does not 2017-05-11 04:33:14 +00:00
rump_wmd Clarify that -l params must be given after options. 2014-01-28 14:02:54 +00:00
rup Drop main() prototype. 2016-09-05 00:40:28 +00:00
ruptime Remove second copy for RCS Id. 2014-01-04 15:43:27 +00:00
rusers Fix whitespace nits. Suggested by Bug Hunting. 2012-03-22 07:58:16 +00:00
rwall
rwho
script static + __dead 2011-09-06 18:29:35 +00:00
sdiff use strtonum from libc (Kamil Rytarowski) 2015-01-29 03:28:19 +00:00
sdpquery update several profiles, bringing up to date decoding of all the 2015-12-11 21:05:18 +00:00
sed PR/49872:Yorick Hardy: sed functions 'i' and 'a' discard leading white space 2016-04-05 00:13:03 +00:00
seq Drop main() prototype. 2016-09-05 00:40:28 +00:00
shar Fix whitespace nits. Suggested by Bug Hunting. 2012-03-22 07:58:16 +00:00
shlock Fix casts which are inconsistent with *printf() formats and remove the 2015-04-10 09:34:43 +00:00
shmif_dumpbus Use autoconf for rump kernel posix hypercall layer. 2014-11-04 19:05:17 +00:00
showmount PR/50712: David Binderman: Fix memory leaks. 2016-01-26 16:23:27 +00:00
shuffle Fix misuse of arc4random by using arc4random_uniform. 2017-02-06 02:26:44 +00:00
skey Use __dead 2011-09-16 15:39:25 +00:00
skeyinfo
skeyinit Fix capitalisation (again, last time the wrong sentence). 2013-05-06 13:44:17 +00:00
sockstat don't do _KERNEL; hides bswap stuff. 2017-01-14 01:01:48 +00:00
soelim Drop main() prototype. 2016-09-05 00:40:28 +00:00
sort refactor includes, add <sys/stat.h> 2017-01-10 21:13:45 +00:00
sortinfo Free the buffer allocated by getline(3). 2017-04-30 13:45:06 +00:00
spell Spell NULL pointer as NULL. 2013-11-18 19:55:59 +00:00
split needs <sys/stat.h> 2017-01-10 21:14:13 +00:00
stat Change some standard exit status text to ".Ex -std" 2014-04-13 01:45:34 +00:00
su Undo last commit - wrong tree. 2018-02-26 00:04:23 +00:00
sys_info Following positive feedback on tech-userlevel, move the sys_info 2016-06-04 15:27:11 +00:00
systat Pull up following revision(s) (requested by mlelstv in ticket #138): 2017-07-25 01:43:37 +00:00
tabs Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
tail PR/50322: Timo Buhrmester: tail -F <file> misbehaves with stdin closed 2015-10-09 17:51:26 +00:00
talk fix some error handling. 2015-06-16 22:54:10 +00:00
tcopy ANSIfy + static + __dead 2011-09-06 18:32:26 +00:00
tee Drop main() prototype. 2016-09-05 00:40:28 +00:00
telnet Remove MKCRYPTO option. 2017-05-21 15:28:36 +00:00
tftp storage class first, *then* __dead 2016-09-03 06:00:32 +00:00
tic fix the tools build. reported by Utkarsh Anand 2017-05-05 12:21:28 +00:00
time Add an xref to wait4(2) in SEE ALSO as it has been referred to for the -l option. 2016-12-21 18:01:21 +00:00
timeout typo 2016-10-13 06:22:26 +00:00
tip Drop main() prototype. 2016-09-05 00:40:28 +00:00
touch Update the description of the -t option to bring it in sync with IEEE 1003.1 -2008. 2016-12-24 15:49:18 +00:00
tpfmt make the result stable. 2012-02-03 05:06:08 +00:00
tput Use putp(3) to output our strings. 2013-02-05 11:31:56 +00:00
tr Pull up following revision(s) (requested by leot in ticket #850): 2018-06-08 10:02:59 +00:00
true
tset Restore logic for setting the VERASE character. 2015-06-21 08:23:22 +00:00
tsort ANSIfy, static + __dead 2011-09-06 18:34:37 +00:00
tty ANSIfy + __dead 2011-09-06 18:34:57 +00:00
ul Add a FILES section and add references to terminfo(3), terminfo(5) in SEE ALSO. 2016-06-24 12:03:22 +00:00
uname ANSIfy + __dead 2011-09-06 18:34:57 +00:00
unexpand PR/50750: David Binderman: Check bounds before dereference 2016-02-03 05:32:14 +00:00
unifdef PR/47068: unifdef(1) with cpp directive on last line without newline 2012-10-13 18:26:03 +00:00
uniq Fix the bug introduced in the previous commit. 2016-10-16 06:17:51 +00:00
units Add most common thai length/area measurements of wah rai ngan 2017-03-21 01:21:59 +00:00
unvis RFC 1866 does not define any "URI encoding". It defines HTML 2.0 that 2012-12-15 02:08:13 +00:00
unzip Remove MKCRYPTO option. 2017-05-21 15:28:36 +00:00
usbhidaction PR 51754 Charlotte Koch: fix -v output of config parser. 2016-12-31 10:13:15 +00:00
usbhidctl Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
users Drop main() prototype. 2016-09-05 00:40:28 +00:00
utoppya filesystem -> file system. 2015-06-21 12:05:11 +00:00
uudecode Support both "-" and "/dev/stdout" as references to standard 2013-01-28 19:50:30 +00:00
uuencode Remove reference to uucp(1) in SEE ALSO, as it is no more there. 2016-06-06 15:09:33 +00:00
uuidgen Use __dead 2011-09-16 15:39:25 +00:00
vacation PR/47689: rudolf: reference to sendmail(8) instead of (1) in vacation(1) 2013-03-24 21:00:22 +00:00
vgrind Drop main() prototype. 2016-09-05 00:40:28 +00:00
videoctl Use __dead 2011-09-16 15:39:25 +00:00
vis Add -N (VIS_NOLOCALE), sort. 2015-05-24 19:42:39 +00:00
vmstat Pull up following revision(s) (requested by nakayama in ticket #606): 2018-03-06 11:15:33 +00:00
vndcompress Omit needless XXX comment. 2017-04-17 00:02:45 +00:00
w if there is more than one : it is not an X display, it is a v6 address 2016-11-16 02:03:30 +00:00
wall PR/50454: Timo Buhrmester: Fix wrong allocation for wall(1) -g 2015-11-21 14:59:51 +00:00
wc Sort sections. From Henning Petersen in PR 49222. 2014-09-19 16:02:58 +00:00
what Clarify that SCCS is a specific thing and not a generic thing. 2015-12-12 09:52:40 +00:00
whatis static + __dead 2011-09-06 18:46:03 +00:00
whereis Sort sections. From Henning Petersen in PR 49222. 2014-09-19 16:02:58 +00:00
who WARNS=6 2015-11-21 15:01:43 +00:00
whois It helps to separate arguments from the query. 2013-02-20 09:27:52 +00:00
write static + __dead 2011-09-06 18:46:35 +00:00
xargs Remove a few unneeded Pp macros. 2012-10-13 14:18:16 +00:00
xinstall Move __MKTEMP_OK up earlier so it has an actual impact. Reduces the 2016-05-31 06:55:02 +00:00
xlint Accept PTR for addtype 2017-03-06 23:04:52 +00:00
xstr PR/50953: David Binderman: Fix misplaced paren 2016-03-11 18:39:03 +00:00
yes
ypcat New sentence, new line. Wording. 2012-03-04 11:54:06 +00:00
ypmatch New sentence, new line. Wording. 2012-03-04 11:54:06 +00:00
ypwhich src is too big these days to tolerate superfluous apostrophes. It's 2014-10-18 08:33:23 +00:00
Makefile Remove MKCRYPTO option. 2017-05-21 15:28:36 +00:00
Makefile.inc Default to WARNS=5 2012-03-21 05:47:53 +00:00