nalika / rpms / bash

Forked from rpms/bash 2 years ago
Clone

Blame SOURCES/bash-4.4-assignment-error.patch

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