OSDN Git Service

Make ls default to -C if no option specified and it's outputting to a tty.
authorRob Landley <rob@landley.net>
Thu, 15 Nov 2012 22:15:51 +0000 (16:15 -0600)
committerRob Landley <rob@landley.net>
Thu, 15 Nov 2012 22:15:51 +0000 (16:15 -0600)
toys/posix/ls.c

index 201c7e2..70200e7 100644 (file)
@@ -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"