commit 0e1f7fe2ef1f9e8375a19b686754914f62af60d7
parent 3eff34b07576ed72941956358f9b3031bac75add
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 31 Jul 2020 20:34:50 +0200
tweaks: normalize the indentation, and regroup two lines
Diffstat:
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git 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)