Date: Wed, 19 Oct 2011 15:35:41 +0000 (UTC) From: Dag-Erling Smorgrav <des@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r226546 - head/bin/ls Message-ID: <201110191535.p9JFZfUu031033@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: des Date: Wed Oct 19 15:35:41 2011 New Revision: 226546 URL: http://svn.freebsd.org/changeset/base/226546 Log: If ls was invoked with -i but neither -l nor -s, blocksize was used in display() to calculate column widths, but was not initialized in main(). This resulted in a division by zero. Noticed by: Michael Butler <imb@protected-networks.net> Modified: head/bin/ls/ls.c Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Wed Oct 19 14:38:01 2011 (r226545) +++ head/bin/ls/ls.c Wed Oct 19 15:35:41 2011 (r226546) @@ -414,8 +414,8 @@ main(int argc, char *argv[]) fts_options |= FTS_WHITEOUT; #endif - /* If -l or -s, figure out block size. */ - if (f_longform || f_size) { + /* If -i, -l or -s, figure out block size. */ + if (f_inode || f_longform || f_size) { if (f_kblocks) blocksize = 2; else {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110191535.p9JFZfUu031033>