From 4d4dcc7aefa33f128b4914e426ea2429aa15b150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Wed, 19 Oct 2011 15:35:41 +0000 Subject: [PATCH] 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 --- bin/ls/ls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/ls/ls.c b/bin/ls/ls.c index 29471a694e20..b6373e20c1f5 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -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 {