From 00b8eb1b8463bf911c6694d89a7a8eb893cc9be1 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 08:17:52 +0000 Subject: Apply patch bash-4.4-assignment-error.patch patch_name: bash-4.4-assignment-error.patch present_in_specfile: true location_in_specfile: 47 --- diff --git a/execute_cmd.h b/execute_cmd.h index d42dc85..439f91a 100644 --- a/execute_cmd.h +++ b/execute_cmd.h @@ -37,6 +37,9 @@ struct func_array_state }; #endif +/* Variables delared in execute_cmd.c, used by many other files */ +extern int executing_command_builtin; + extern struct fd_bitmap *new_fd_bitmap __P((int)); extern void dispose_fd_bitmap __P((struct fd_bitmap *)); extern void close_fd_bitmap __P((struct fd_bitmap *)); diff --git a/subst.c b/subst.c index 18f91b6..5f3e41e 100644 --- a/subst.c +++ b/subst.c @@ -10678,11 +10678,12 @@ expand_word_list_internal (list, eflags) tint = do_word_assignment (temp_list->word, 0); this_command_name = savecmd; /* Variable assignment errors in non-interactive shells - running in Posix.2 mode cause the shell to exit. */ + running in Posix.2 mode cause the shell to exit, unless + they are being run by the `command' builtin. */ if (tint == 0) { last_command_exit_value = EXECUTION_FAILURE; - if (interactive_shell == 0 && posixly_correct) + if (interactive_shell == 0 && posixly_correct && executing_command_builtin == 0) exp_jump_to_top_level (FORCE_EOF); else exp_jump_to_top_level (DISCARD);