From: Rob Landley Date: Thu, 15 Nov 2012 22:15:51 +0000 (-0600) Subject: Make ls default to -C if no option specified and it's outputting to a tty. X-Git-Tag: 0.4.2~53 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02261e8082b9b098b20a4291fc2583f3c41db8d2;p=platform%2Fupstream%2Ftoybox.git Make ls default to -C if no option specified and it's outputting to a tty. --- diff --git a/toys/posix/ls.c b/toys/posix/ls.c index 201c7e2..70200e7 100644 --- a/toys/posix/ls.c +++ b/toys/posix/ls.c @@ -426,6 +426,7 @@ void ls_main(void) else { TT.screen_width = 80; terminal_size(&TT.screen_width, NULL); + if (!(toys.optflags&(FLAG_1|FLAG_x|FLAG_m))) toys.optflags |= FLAG_C; } // The optflags parsing infrastructure should really do this for us, // but currently it has "switch off when this is set", so "-dR" and "-Rd"