From: Robert Pengelly Date: Mon, 15 Sep 2025 05:25:01 +0000 (+0100) Subject: If running ls without any arguments default to ls -C so that no newlines are added X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=9ed86994634d1b73620b415e9e7626cb564d4516;p=xmake.git If running ls without any arguments default to ls -C so that no newlines are added --- diff --git a/xmake.c b/xmake.c index 4b1d5af..e25b188 100644 --- a/xmake.c +++ b/xmake.c @@ -447,6 +447,16 @@ static int pipe_command (const char *filename, unsigned long line_no, char *inpu argv[0] = prog; argv[argc] = 0; + if (strcmp (prog, "ls") == 0 && argc == 1) { + + argv = xrealloc (argv, sizeof (*argv) * 3); + argc = 2; + + argv[1] = "-C"; + argv[2] = 0; + + } + dup2 (pipefd[1], STDOUT_FILENO); close (pipefd[0]);