Bug in 4.1bsd "ls" (already fixed in 4.2) (with 4.1 fix) (reposting)

Arthur David Olson ado at elsie.UUCP
Sat Sep 15 09:01:29 AEST 1984


Subject--	/usr/src/cmd/ls/ucbls.c

Challenge--	"ls" sometimes does columnar output incorrectly.

Example--	On an eighty-column terminal,

		mkdir dummy
		cd dummy
		tee a b c dddddddd e ff < /dev/null
		ls a b c dddddddd e ff

		and note that an eighty-one character long line is produced.
		Be sure to
		cd ..
		rm -f -r dummy

Solution--	ed /usr/src/cmd/ls/ucbls.c
		/colwidth = fixedwidth + filewidth/a
		#ifndef OLDVERSION
			if (tabflg)
				if (colwidth <= 9)
					colwidth = 8;
				else if (colwidth <= 17)
					colwidth = 16;
		#endif
		.
		w
		q
--
	...decvax!seismo!umcp-cs!elsie!ado	(301) 496-5688
	(DEC, VAX and Elsie are Digital Equipment Corp. and Borden's trademarks)
	(We're your gateway to Montgomery County, MD--where bureaucrats live)



More information about the Comp.bugs.4bsd.ucb-fixes mailing list