]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
commit bash-20190705 snapshot
authorChet Ramey <chet.ramey@case.edu>
Mon, 8 Jul 2019 18:42:24 +0000 (14:42 -0400)
committerChet Ramey <chet.ramey@case.edu>
Mon, 8 Jul 2019 18:42:24 +0000 (14:42 -0400)
CWRU/CWRU.chlog
builtins/bind.def
execute_cmd.c
jobs.c
print_cmd.c
subst.c
tests/glob.right

index f9a92c4660ce9c575c3ddb430b4dc99db4977a09..9eaa35d50323cc432e7a74ff865882adbd07959b 100644 (file)
@@ -6201,3 +6201,30 @@ pathexp.c
        - unquoted_glob_pattern_p: when in a bracket expression (open > 0),
          don't allow an unquoted slash as part of the bracket expression.
          Report from Stephane Chazelas <stephane.chazelas@gmail.com>
+
+                                   7/1
+                                   ---
+print_cmd.c
+       - print_function_def,named_function_string: make sure to call
+         PRINT_DEFERRED_HEREDOCS to finish printing any here documents and
+         delimiters before printing the function closing brace. Fixes bug
+         reported by Denis McKeon <dmckeon@swcp.com>
+
+execute_cmd.c
+       - execute_command_internal: call reap_procsubs at the end of executing
+         a group command on systems that have /dev/fd. Fixes bug reported by
+         kfm@plushkava.net
+
+                                   7/3
+                                   ---
+jobs.c
+       - waitchld: this is in the potential SIGCHLD path, so don't call
+         bgp_add, which can potentially call malloc. The glibc malloc doesn't
+         handle that well. Report from howaboutsynergy@protonmail.com
+
+                                   7/5
+                                   ---
+builtins/bind.def
+       - bind_builtin: make sure return_code is >= 0 before returning it.
+         Fixes bug with bind -x and invalid key sequences reported by
+         bashbug@jonkmans.nl
index 0853a20997bb215ceb5f0189a4c1a41fea690aa7..5290592dbb58b361a50d6c76c1640044ba20b451 100644 (file)
@@ -287,6 +287,9 @@ bind_builtin (list)
 
   run_unwind_frame ("bind_builtin");
 
+  if (return_code < 0)
+    return_code = EXECUTION_FAILURE;
+
   return (sh_chkwrite (return_code));
 }
 
index e094bddb0d7ca56482f44d9f80884162f9d5476e..6c50d0c9aa3322749167c14037f719c8ba8d93f9 100644 (file)
@@ -781,33 +781,11 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
       return (last_command_exit_value = EXECUTION_FAILURE);
     }
 
-#if 0
-  if (redirection_undo_list)
-    {
-      /* XXX - why copy here? */
-      my_undo_list = (REDIRECT *)copy_redirects (redirection_undo_list);
-      dispose_partial_redirects ();
-    }
-  else
-    my_undo_list = (REDIRECT *)NULL;
-#else
   my_undo_list = redirection_undo_list;
   redirection_undo_list = (REDIRECT *)NULL;
-#endif
 
-#if 0
-  if (exec_redirection_undo_list)
-    {
-      /* XXX - why copy here? */
-      exec_undo_list = (REDIRECT *)copy_redirects (exec_redirection_undo_list);
-      dispose_exec_redirects ();
-    }
-  else
-    exec_undo_list = (REDIRECT *)NULL;
-#else
   exec_undo_list = exec_redirection_undo_list;
   exec_redirection_undo_list = (REDIRECT *)NULL;
-#endif
 
   if (my_undo_list || exec_undo_list)
     begin_unwind_frame ("loop_redirections");
@@ -1113,6 +1091,7 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
     case cm_while:
     case cm_until:
     case cm_for:
+    case cm_group:
 #    if defined (ARITH_FOR_COMMAND)
     case cm_arith_for:
 #    endif
@@ -2715,7 +2694,14 @@ execute_connection (command, asynchronous, pipe_in, pipe_out, fds_to_close)
        }
       executing_list++;
       QUIT;
+#if 1
       execute_command (command->value.Connection->first);
+#else
+      execute_command_internal (command->value.Connection->first,
+                                 asynchronous, pipe_in, pipe_out,
+                                 fds_to_close);
+#endif
+
       QUIT;
       optimize_fork (command);                 /* XXX */
       exec_result = execute_command_internal (command->value.Connection->second,
@@ -2779,7 +2765,11 @@ execute_connection (command, asynchronous, pipe_in, pipe_out, fds_to_close)
       if (command->value.Connection->first)
        command->value.Connection->first->flags |= CMD_IGNORE_RETURN;
 
+#if 1
       exec_result = execute_command (command->value.Connection->first);
+#else
+      exec_result = execute_command_internal (command->value.Connection->first, 0, NO_PIPE, NO_PIPE, fds_to_close);
+#endif
       QUIT;
       if (((command->value.Connection->connector == AND_AND) &&
           (exec_result == EXECUTION_SUCCESS)) ||
diff --git a/jobs.c b/jobs.c
index d81bc238c3ef56f8145ce7489c56c860a92fa267..049bde1c8e37eadf5b892b8c2d1c58bf433835c5 100644 (file)
--- a/jobs.c
+++ b/jobs.c
@@ -3695,10 +3695,7 @@ itrace("waitchld: waitpid returns %d block = %d children_exited = %d", pid, bloc
       /* Only manipulate the list of process substitutions while SIGCHLD
         is blocked. */
       if ((ind = find_procsub_child (pid)) >= 0)
-       {
-         set_procsub_status (ind, pid, WSTATUS (status));
-         bgp_add (pid, WSTATUS (status));
-       }
+       set_procsub_status (ind, pid, WSTATUS (status));
 #endif
 
       /* It is not an error to have a child terminate that we did
index 9aa6557dd6810cae5219dcf48e971f1264207d48..c392f320a6a3c35737286da1250738b8449f6394 100644 (file)
@@ -1312,7 +1312,7 @@ print_function_def (func)
   make_command_string_internal (cmdcopy->type == cm_group
                                        ? cmdcopy->value.Group->command
                                        : cmdcopy);
-  /* XXX - PRINT_DEFERRED_HEREDOCS (""); ? */
+  PRINT_DEFERRED_HEREDOCS ("");
 
   remove_unwind_protect ();
   indentation -= indentation_amount;
@@ -1388,7 +1388,7 @@ named_function_string (name, command, flags)
   make_command_string_internal (cmdcopy->type == cm_group
                                        ? cmdcopy->value.Group->command
                                        : cmdcopy);
-  /* XXX - PRINT_DEFERRED_HEREDOCS (""); ? */
+  PRINT_DEFERRED_HEREDOCS ("");
 
   indentation = old_indent;
   indentation_amount = old_amount;
diff --git a/subst.c b/subst.c
index 3a70d725ca36f681f844d6cb742fb350804528e9..ac3f61bad41468313d89800a2527db68f0e17abd 100644 (file)
--- a/subst.c
+++ b/subst.c
@@ -5515,6 +5515,7 @@ wait_procsubs ()
       if (fifo_list[i].proc != (pid_t)-1 && fifo_list[i].proc > 0)
        {
          r = wait_for (fifo_list[i].proc);
+         /* add to bgpids list? have to make interface public */
          fifo_list[i].proc = (pid_t)-1;
        }
     }
@@ -5748,6 +5749,7 @@ wait_procsubs ()
       if (dev_fd_list[i] != (pid_t)-1 && dev_fd_list[i] > 0)
        {
          r = wait_for (dev_fd_list[i]);
+         /* add to bgpids list? have to make interface public */
          dev_fd_list[i] = (pid_t)-1;
        }
     }
index 124338419ff37ef08ab266f44bd7e6924d21f931..df576cc9c5fb7b1df8dd2e7d0ef6460b182ccaa7 100644 (file)
@@ -91,6 +91,24 @@ argv[1] = <./tmp/>
 argv[1] = <\$foo>
 argv[2] = <\$foo>
 argv[1] = <mixed\$foo/>
+<abcdefg>
+<.>
+*abc.c
+searchable/.
+searchable/./.
+readable/\.
+readable/\./.
+searchable/\.
+readable/\.
+searchable/.
+searchable/.
+searchable/.
+1: [qwe/qwe]
+2: [qwe/
+3: [qwe/]
+4:
+5: [qwe/
+6:
 argv[1] = <a>
 argv[2] = <abc>
 argv[3] = <abd>
@@ -105,7 +123,7 @@ argv[2] = <abc>
 argv[3] = <abd>
 argv[4] = <abe>
 tmp/l1 tmp/l2 tmp/*4 tmp/l3
-./glob.tests: line 48: no match: tmp/*4
+./glob.tests: line 50: no match: tmp/*4
 argv[1] = <bdir/>
 argv[1] = <*>
 argv[1] = <a*>