fix longjmp error when timing null command in posix mode; unset exit trap in subshells before checking for pending fatal signal; changes for gcc sometimes-uninitialized warning

This commit is contained in:
Chet Ramey
2025-12-02 17:15:44 -05:00
parent 4e705ed53a
commit 5a104e96d8
10 changed files with 57 additions and 21 deletions
+5
View File
@@ -1489,6 +1489,8 @@ time_command (COMMAND *command, int asynchronous, int pipe_in, int pipe_out, str
rsf = usf = ssf = 0;
cpu = 0;
code = 0;
old_subshell = subshell_environment;
posix_time = command && (command->flags & CMD_TIME_POSIX);
nullcmd = (command == 0) || (command->type == cm_simple && command->value.Simple->words == 0 && command->value.Simple->redirects == 0);
@@ -1686,6 +1688,9 @@ execute_in_subshell (COMMAND *command, int asynchronous, int pipe_in, int pipe_o
subshell_environment |= SUBSHELL_COPROC;
}
/* clear the exit trap before checking for fatal signals */
clear_exit_trap ();
QUIT;
CHECK_TERMSIG;