nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit cac5b9ba33e64177c5358cb398883bcc344969f4
parent df05f593de129ffad590e075db0cbad8ae6b98e8
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date:   Mon, 16 Jan 2023 00:18:19 +0530

Revert "Concatenate arguments to pass to `sh`"

This reverts commit 428c652d365b8571ea8b93bfca9e505f5ff14251.

Diffstat:
Msrc/nnn.c | 19+------------------
1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/src/nnn.c b/src/nnn.c @@ -4490,29 +4490,12 @@ static bool get_output(char *file, char *arg1, char *arg2, int fdout, bool page) pid = fork(); if (pid == 0) { /* In child */ - char *bufptr = file; - close(cmd_in_fd); dup2(cmd_out_fd, STDOUT_FILENO); dup2(cmd_out_fd, STDERR_FILENO); close(cmd_out_fd); - if (bufptr && arg1) { - char argbuf[CMD_LEN_MAX]; - - len = xstrsncpy(argbuf, file, xstrlen(file) + 1); - argbuf[len - 1] = ' '; - bufptr = argbuf + len; - len = xstrsncpy(bufptr, arg1, xstrlen(arg1) + 1); - if (arg2) { - bufptr[len - 1] = ' '; - xstrsncpy(bufptr + len, arg2, xstrlen(arg2) + 1); - } - - bufptr = argbuf; - } - - spawn(utils[UTIL_SH_EXEC], bufptr, NULL, NULL, F_MULTI); + spawn(utils[UTIL_SH_EXEC], file, arg1, arg2, F_MULTI); _exit(EXIT_SUCCESS); }