rcolebaugh / rpms / bash

Forked from rpms/bash 2 years ago
Clone
3fb13f
diff --git a/execute_cmd.h b/execute_cmd.h
3fb13f
--- a/execute_cmd.h
3fb13f
+++ b/execute_cmd.h
3fb13f
@@ -37,6 +37,9 @@ struct func_array_state
3fb13f
   };
3fb13f
 #endif
3fb13f
 
3fb13f
+/* Variables delared in execute_cmd.c, used by many other files */
3fb13f
+extern int executing_command_builtin;
3fb13f
+
3fb13f
 extern struct fd_bitmap *new_fd_bitmap __P((int));
3fb13f
 extern void dispose_fd_bitmap __P((struct fd_bitmap *));
3fb13f
 extern void close_fd_bitmap __P((struct fd_bitmap *));
3fb13f
diff --git a/subst.c b/subst.c
3fb13f
--- a/subst.c
3fb13f
+++ b/subst.c
3fb13f
@@ -10676,11 +10676,12 @@ expand_word_list_internal (list, eflags)
3fb13f
 		  tint = do_word_assignment (temp_list->word, 0);
3fb13f
 		  this_command_name = savecmd;
3fb13f
 		  /* Variable assignment errors in non-interactive shells
3fb13f
-		     running in Posix.2 mode cause the shell to exit. */
3fb13f
+		     running in Posix.2 mode cause the shell to exit, unless 
3fb13f
+		     they are being run by the `command' builtin. */
3fb13f
 		  if (tint == 0)
3fb13f
 		    {
3fb13f
 		      last_command_exit_value = EXECUTION_FAILURE;
3fb13f
-		      if (interactive_shell == 0 && posixly_correct)
3fb13f
+		      if (interactive_shell == 0 && posixly_correct && executing_command_builtin == 0)
3fb13f
 			exp_jump_to_top_level (FORCE_EOF);
3fb13f
 		      else
3fb13f
 			exp_jump_to_top_level (DISCARD);