NetBSD/usr.bin/printf
kre f910883c96 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-10 14:42:29 +00:00
..
Makefile
printf.1 PR standards/53563 2018-08-31 17:27:35 +00:00
printf.c A truly ancient bug found by Edgar Fuss 2018-09-10 14:42:29 +00:00