Make subcommands modify $status, and make builtin_set not modify status unless it fails

https://github.com/fish-shell/fish-shell/issues/547
https://github.com/fish-shell/fish-shell/issues/214
This commit is contained in:
ridiculousfish
2013-01-31 15:57:08 -08:00
parent 0db1b6ce44
commit ad8d68dd43
21 changed files with 143 additions and 139 deletions

View File

@@ -465,7 +465,7 @@ bool completer_t::condition_test(const wcstring &condition)
if (cached_entry == condition_cache.end())
{
/* Compute new value and reinsert it */
test_res = (0 == exec_subshell(condition));
test_res = (0 == exec_subshell(condition, false /* don't apply exit status */));
condition_cache[condition] = test_res;
}
else
@@ -1007,7 +1007,7 @@ void completer_t::complete_cmd_desc(const wcstring &str)
since apropos is only called once.
*/
wcstring_list_t list;
if (exec_subshell(lookup_cmd, list) != -1)
if (exec_subshell(lookup_cmd, list, false /* don't apply exit status */) != -1)
{
/*