From 1cf392a401c67c2f8437f2da459dfcf0f675dc55 Mon Sep 17 00:00:00 2001 From: Ingo Karkat Date: Thu, 30 Jun 2016 12:30:59 +0200 Subject: [PATCH 1/1] Exit status of fc -e is the wrong way around fc_execute_file() delegates to _evalfile(), which only returns the result of the file's execution if FEVAL_BUILTIN is set (exemplified by source_file()). If unset, an indication of whether the file exists is returned instead (exemplified by maybe_execute_file(), which is used for the .bash_profile, .bash_login, .profile optional init chain). According to the manual (and common sense), fc -e editor should return the recalled command's success. For that, the FEVAL_BUILTIN flag needs to be set. --- builtins/evalfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtins/evalfile.c b/builtins/evalfile.c index 058d99d..e5c118b 100644 --- a/builtins/evalfile.c +++ b/builtins/evalfile.c @@ -331,7 +331,7 @@ fc_execute_file (filename) /* We want these commands to show up in the history list if remember_on_history is set. */ - flags = FEVAL_ENOENTOK|FEVAL_HISTORY|FEVAL_REGFILE; + flags = FEVAL_ENOENTOK|FEVAL_BUILTIN|FEVAL_HISTORY|FEVAL_REGFILE; return (_evalfile (filename, flags)); } #endif /* HISTORY */ -- 1.9.1