From 9ed86994634d1b73620b415e9e7626cb564d4516 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Mon, 15 Sep 2025 06:25:01 +0100 Subject: [PATCH] If running ls without any arguments default to ls -C so that no newlines are added --- xmake.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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]); -- 2.34.1