summaryrefslogtreecommitdiff
path: root/execute_cmd.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2011-12-12 22:14:43 -0500
committerChet Ramey <chet.ramey@case.edu>2011-12-12 22:14:43 -0500
commitf894a2d39bfd26d4cf50ba69f79e58747f52b759 (patch)
tree29efe9a0d4a857c313696e1319a234cd831618d4 /execute_cmd.c
parentdeeba0d2f77b93ae78d874411a7e4177c3c26d66 (diff)
downloadbash-f894a2d39bfd26d4cf50ba69f79e58747f52b759.tar.gz
commit bash-20110121 snapshot
Diffstat (limited to 'execute_cmd.c')
-rw-r--r--execute_cmd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/execute_cmd.c b/execute_cmd.c
index f1b5ba49..3e33f3f6 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -3645,6 +3645,7 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
pid_t old_last_async_pid;
sh_builtin_func_t *builtin;
SHELL_VAR *func;
+ volatile int old_builtin, old_command_builtin;
result = EXECUTION_SUCCESS;
special_builtin_failed = builtin_is_special = 0;
@@ -3895,6 +3896,8 @@ run_builtin:
{
if (builtin)
{
+ old_builtin = executing_builtin;
+ old_command_builtin = executing_command_builtin;
unwind_protect_int (executing_builtin); /* modified in execute_builtin */
unwind_protect_int (executing_command_builtin); /* ditto */
}
@@ -3979,6 +3982,11 @@ run_builtin:
bind_lastarg (lastarg);
FREE (command_line);
dispose_words (words);
+ if (builtin)
+ {
+ executing_builtin = old_builtin;
+ executing_command_builtin = old_command_builtin;
+ }
discard_unwind_frame ("simple-command");
this_command_name = (char *)NULL; /* points to freed memory now */
return (result);