mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-05 00:01:15 -03:00
Log original exit code used when a builtin returns a negative exit code
Port of b91723dab6
This commit is contained in:
@@ -456,16 +456,16 @@ pub fn builtin_run(parser: &Parser, argv: &mut [&wstr], streams: &mut IoStreams)
|
||||
// would assert() out, which is a terrible failure mode
|
||||
// So instead, what we do is we get a positive code,
|
||||
// and we avoid 0.
|
||||
code = ((256 + code) % 256).abs();
|
||||
if code == 0 {
|
||||
code = 255;
|
||||
}
|
||||
FLOGF!(
|
||||
warning,
|
||||
"builtin %ls returned invalid exit code %d",
|
||||
argv[0],
|
||||
code
|
||||
);
|
||||
code = ((256 + code) % 256).abs();
|
||||
if code == 0 {
|
||||
code = 255;
|
||||
}
|
||||
}
|
||||
|
||||
ProcStatus::from_exit_code(code)
|
||||
|
||||
Reference in New Issue
Block a user