aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/ls.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-11-15 16:15:51 -0600
committerRob Landley <rob@landley.net>2012-11-15 16:15:51 -0600
commit02261e8082b9b098b20a4291fc2583f3c41db8d2 (patch)
tree1bd772a2184d205240aba279854fe67bea8b8d0d /toys/posix/ls.c
parent7aa651a6a4496d848f86de9b1e6b3a003256a01f (diff)
downloadtoybox-02261e8082b9b098b20a4291fc2583f3c41db8d2.tar.gz
Make ls default to -C if no option specified and it's outputting to a tty.
Diffstat (limited to 'toys/posix/ls.c')
-rw-r--r--toys/posix/ls.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/toys/posix/ls.c b/toys/posix/ls.c
index 201c7e24..70200e7c 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"