mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 23:24:39 +00:00
exec: Don't format status returned directly from builtin function
The builtin function returns the raw status, which is not the same as the integer return by waitpid. Therefore, the WIF macros shouldn't be used for checking or obtaining the status. This bug can be seen by executing (eval false). The builtin eval function returns 1, but proc_format_status misinterprets it as a signal by checking WIFSIGNALED, so adds 128 to the status to return 129. Signed-off-by: Grissiom <chaos.proton@gmail.com>
This commit is contained in:
parent
9f3a4d1640
commit
364d3dbbf8
1 changed files with 1 additions and 1 deletions
2
exec.c
2
exec.c
|
@ -1575,7 +1575,7 @@ void exec( job_t *j )
|
|||
{
|
||||
debug( 3, L"Set status of %ls to %d using short circut", j->command, p->status );
|
||||
|
||||
int status = proc_format_status(p->status);
|
||||
int status = p->status;
|
||||
proc_set_last_status( job_get_flag( j, JOB_NEGATE )?(!status):status );
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue