From 0e1f7fe2ef1f9e8375a19b686754914f62af60d7 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 31 Jul 2020 20:34:50 +0200 Subject: [PATCH] tweaks: normalize the indentation, and regroup two lines --- src/text.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/text.c b/src/text.c index 0639e932..62930ff8 100644 --- a/src/text.c +++ b/src/text.c @@ -2123,14 +2123,13 @@ const char *treat(char *tempfile_name, char *theprogram, bool spelling) /* Terminate the child if the program is not found. */ exit(9); } else if (thepid > 0) { - /* Block SIGWINCHes while waiting for the program to end, - * so nano doesn't get pushed past the wait(). */ - block_sigwinch(TRUE); - wait(&program_status); - block_sigwinch(FALSE); - } - - errornumber = errno; + /* Block SIGWINCHes while waiting for the forked program to end, + * so nano doesn't get pushed past the wait(). */ + block_sigwinch(TRUE); + wait(&program_status); + block_sigwinch(FALSE); + } else + errornumber = errno; /* Restore the terminal state and reenter curses mode. */ terminal_init(); @@ -2139,9 +2138,7 @@ const char *treat(char *tempfile_name, char *theprogram, bool spelling) if (thepid < 0) { statusline(ALERT, _("Could not fork: %s"), strerror(errornumber)); return NULL; - } - - if (!WIFEXITED(program_status) || WEXITSTATUS(program_status) > 2) { + } else if (!WIFEXITED(program_status) || WEXITSTATUS(program_status) > 2) { statusline(ALERT, _("Error invoking '%s'"), arguments[0]); return NULL; } else if (WEXITSTATUS(program_status) != 0)