nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 1ae10b1487875c21fbe108d0fc2d3104be1babc4
parent 35cde9f8d7abcf22f9466d6b4aa93a37636f413c
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon,  3 Oct 2022 10:21:22 +0200

tweaks: elide an unused return value

The execute_command() function — then called open_pipe() — was changed
to have a boolean return value in commit ce62e82a eighteen years ago,
but the value has never been used or checked.

Diffstat:
Msrc/files.c | 12++++--------
1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/files.c b/src/files.c @@ -1002,8 +1002,8 @@ void send_data(const linestruct *line, int fd) fclose(tube); } -/* Execute the given command in a shell. Return TRUE on success. */ -bool execute_command(const char *command) +/* Execute the given command in a shell. */ +void execute_command(const char *command) { #if defined(HAVE_FORK) && defined(HAVE_PIPE) && defined(HAVE_WAIT) int from_fd[2], to_fd[2]; @@ -1018,7 +1018,7 @@ bool execute_command(const char *command) * a pipe to feed the command's input through. */ if (pipe(from_fd) == -1 || (should_pipe && pipe(to_fd) == -1)) { statusline(ALERT, _("Could not create pipe: %s"), strerror(errno)); - return FALSE; + return; } /* Fork a child process to run the command in. */ @@ -1059,7 +1059,7 @@ bool execute_command(const char *command) if (pid_of_command == -1) { statusline(ALERT, _("Could not fork: %s"), strerror(errno)); close(from_fd[0]); - return FALSE; + return; } statusbar(_("Executing...")); @@ -1143,10 +1143,6 @@ bool execute_command(const char *command) /* Restore the terminal to its desired state, and disable * interpretation of the special control keys again. */ terminal_init(); - - return TRUE; -#else - return FALSE; #endif } #endif /* NANO_TINY */