]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20081009 snapshot
authorChet Ramey <chet.ramey@case.edu>
Wed, 7 Dec 2011 14:30:10 +0000 (09:30 -0500)
committerChet Ramey <chet.ramey@case.edu>
Wed, 7 Dec 2011 14:30:10 +0000 (09:30 -0500)
CWRU/CWRU.chlog
CWRU/CWRU.chlog~
builtins/evalstring.c
builtins/evalstring.c~
doc/bashref.texi
doc/bashref.texi~

index 9a02993e7bf421a369b9c795e0fadd4febe08eca..c374509c3f0ae7afe30c35340f37ff52dce1cae8 100644 (file)
@@ -7026,3 +7026,10 @@ execute_cmd.c
        - fix errexit logic to not cause the shell to exit when a command in
          a pipeline fails.  Fixes bug reported by Marcin Owsiany
          <marcin@owsiany.pl>
+
+                                  10/14
+                                  -----
+builtins/evalstring.c
+       - don't short-circuit execution in parse_and_execute if we want to
+         run an exit trap.  Fixes bug reported by Steffen Kiess
+         <s-kiess@web.de>
index 4b25664c133c1d25c2cf5d2e657703f0ff205aa2..9a02993e7bf421a369b9c795e0fadd4febe08eca 100644 (file)
@@ -7024,4 +7024,5 @@ lib/readline/doc/rltech.texi
                                   ----
 execute_cmd.c
        - fix errexit logic to not cause the shell to exit when a command in
-         a pipeline fails
+         a pipeline fails.  Fixes bug reported by Marcin Owsiany
+         <marcin@owsiany.pl>
index 657c98d132b1481a305c4899931b0514f1f25464..13523c0f1447f19744476907f0e2c3c0b97d0501 100644 (file)
@@ -266,6 +266,7 @@ parse_and_execute (string, from_file, flags)
               *   parse_and_execute has not been called recursively AND
               *   we're not running a trap AND
               *   we have parsed the full command (string == '\0') AND
+              *   we're not going to run the exit trap AND
               *   we have a simple command without redirections AND
               *   the command is not being timed AND
               *   the command's return status is not being inverted
@@ -276,7 +277,8 @@ parse_and_execute (string, from_file, flags)
                  running_trap == 0 &&
                  *bash_input.location.string == '\0' &&
                  command->type == cm_simple &&
-                 !command->redirects && !command->value.Simple->redirects &&
+                 signal_is_trapped (EXIT_TRAP) == 0 &&
+                 command->redirects == 0 && command->value.Simple->redirects == 0 &&
                  ((command->flags & CMD_TIME_PIPELINE) == 0) &&
                  ((command->flags & CMD_INVERT_RETURN) == 0))
                {
index e828880b340e9eb133679250ea5bc6442e97af90..419f1432ee06c8d478385809ffb7957eff85d690 100644 (file)
@@ -64,6 +64,7 @@ extern int current_token, shell_eof_token;
 extern int last_command_exit_value;
 extern int running_trap;
 extern int loop_level;
+extern int executing_list;
 extern int posixly_correct;
 
 int parse_and_execute_level = 0;
@@ -110,6 +111,7 @@ parse_prologue (string, flags, tag)
   unwind_protect_int (indirection_level);
   unwind_protect_int (line_number);
   unwind_protect_int (loop_level);
+  unwind_protect_int (executing_list);
   if (flags & (SEVAL_NONINT|SEVAL_INTERACT))
     unwind_protect_int (interactive);
 
@@ -274,7 +276,8 @@ parse_and_execute (string, from_file, flags)
                  running_trap == 0 &&
                  *bash_input.location.string == '\0' &&
                  command->type == cm_simple &&
-                 !command->redirects && !command->value.Simple->redirects &&
+                 signal_is_trapped (EXIT_TRAP) == 0 &&
+                 command->redirects == 0 && command->value.Simple->redirects == 0 &&
                  ((command->flags & CMD_TIME_PIPELINE) == 0) &&
                  ((command->flags & CMD_INVERT_RETURN) == 0))
                {
@@ -363,6 +366,7 @@ parse_string (string, from_file, flags, endp)
     
   code = should_jump_to_top_level = 0;
   oglobal = global_command;
+  ostring = string;
 
   with_input_from_string (string, from_file);
   while (*(bash_input.location.string))
index 2e37ff11e4166e232d974b758dd28ef83c91bda7..3bffbb04203d1202b07aa851ffee4a16f74b1fe9 100644 (file)
@@ -275,6 +275,7 @@ Also referred to as an @code{identifier}.
 @cindex operator, shell
 A @code{control operator} or a @code{redirection operator}.
 @xref{Redirections}, for a list of redirection operators.
+Operators contain at least one unquoted @code{metacharacter}.
 
 @item process group
 @cindex process group
@@ -308,12 +309,13 @@ A shell builtin command that has been classified as special by the
 
 @item token
 @cindex token
-A sequence of characters considered a single unit by the shell.  It is
-either a @code{word} or an @code{operator}.
+A sequence of characters considered a single unit by the shell.
+It is either a @code{word} or an @code{operator}.
 
 @item word
 @cindex word
-A @code{token} that is not an @code{operator}.
+A sequence of characters treated as a unit by the shell.
+Words may not include unquoted @code{metacharacters}.
 @end table
 
 @node Basic Shell Features
index 28d5ac33f2e9e0860724afe0ec3fd692067ff5dd..2e37ff11e4166e232d974b758dd28ef83c91bda7 100644 (file)
@@ -4090,8 +4090,8 @@ Same as @code{-x}.
 Turn on privileged mode.
 In this mode, the @env{$BASH_ENV} and @env{$ENV} files are not
 processed, shell functions are not inherited from the environment,
-and the @env{SHELLOPTS} variable, if it appears in the environment,
-is ignored.
+and the @env{SHELLOPTS}, @env{CDPATH} and @env{GLOBIGNORE}  variables,
+if they appear in the environment, are ignored.
 If the shell is started with the effective user (group) id not equal to the
 real user (group) id, and the @code{-p} option is not supplied, these actions
 are taken and the effective user id is set to the real user id.