diff options
author | Jakob Kaivo <jkk@ung.org> | 2019-09-20 17:02:29 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2019-09-20 17:02:29 -0400 |
commit | 1f74d59ba485b13ae1b3b3f92cf8a7791cc80f96 (patch) | |
tree | b33d835957ac798b89f1a152e0e05ddbf62f0b43 | |
parent | a0b6d46ba7ee686c42fe04bf7028c9e6a58d6722 (diff) |
format one entry per line if stdout is not a tty
-rw-r--r-- | ls.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -17,6 +17,7 @@ * */ +#define _XOPEN_SOURCE 700 #include <stdio.h> #include <sys/stat.h> #include <unistd.h> @@ -541,6 +542,10 @@ main (int argc, char **argv) return 1; } } + + if (!isatty(STDOUT_FILENO)) { + display = SINGLE; + } if (optind >= argc) { strcpy(dirlist[0].path, "."); |