commit bash-20190705 snapshot

This commit is contained in:
Chet Ramey
2019-07-08 14:42:24 -04:00
parent 951bdaad7a
commit ea578790a9
7 changed files with 66 additions and 29 deletions
+27
View 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
+3
View 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));
}
+12 -22
View 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)) ||
+1 -4
View File
@@ -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
+2 -2
View 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;
+2
View File
@@ -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;
}
}
+19 -1
View 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*>