mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-24 00:24:38 +00:00
Shell: Don't reset 'last_return_code' before running commands
Some variables depend on its value to function correctly.
Fixes the following issue:
$ false; echo $?
1
$ false
$ echo $?
128
This commit is contained in:
committed by
Andreas Kling
parent
689fe7ddff
commit
310a18da1e
@@ -3564,7 +3564,7 @@ Vector<String> SpecialVariableValue::resolve_as_list(RefPtr<Shell> shell)
|
||||
|
||||
switch (m_name) {
|
||||
case '?':
|
||||
return { resolve_slices(shell, String::number(shell->last_return_code), m_slices) };
|
||||
return { resolve_slices(shell, String::number(shell->last_return_code.value_or(0)), m_slices) };
|
||||
case '$':
|
||||
return { resolve_slices(shell, String::number(getpid()), m_slices) };
|
||||
case '*':
|
||||
|
||||
Reference in New Issue
Block a user