From 1f74d59ba485b13ae1b3b3f92cf8a7791cc80f96 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Fri, 20 Sep 2019 17:02:29 -0400 Subject: format one entry per line if stdout is not a tty --- ls.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ls.c b/ls.c index feeccb7..d15288f 100644 --- a/ls.c +++ b/ls.c @@ -17,6 +17,7 @@ * */ +#define _XOPEN_SOURCE 700 #include #include #include @@ -541,6 +542,10 @@ main (int argc, char **argv) return 1; } } + + if (!isatty(STDOUT_FILENO)) { + display = SINGLE; + } if (optind >= argc) { strcpy(dirlist[0].path, "."); -- cgit v1.2.1