commit bash-20160115 snapshot

This commit is contained in:
Chet Ramey
2016-01-20 10:41:39 -05:00
parent 725b284a48
commit 1b05a005ef
20 changed files with 127 additions and 82 deletions
+46
View File
@@ -10339,3 +10339,49 @@ lib/readline/bind.c
- rl_parse_and_bind: if a `bare' keybinding is supplied without any
terminating `:' or whitespace separating it from the command to be
bound, signal an error
1/11
----
execute_cmd.c
- process_substitute: when compiled without job control (JOB_CONTROL not
defined), make sure we call stop_making_children like we do in the job
control code branch, so already_making_children is reset to 0. This
is what command substitution does. Fixes bug reported by Alastair
Hughes <hobbitalastair@yandex.com>
1/12
----
execute_cmd.c
- execute_in_subshell: if a user subshell (`(command)') or other shell
compound command has an input pipe, note for later by setting
stdin_redir. This will inhibit the implicit redirection of standard
input from /dev/null for async commands executed as part of this
subshell. Fixes bug reported by Martin D Kealey <martin@kurahaupo.gen.nz>
- execute_simple_command: if the shell forks to execute this command
because it has an input pipe, set stdin_redir to inhibit later redirection
from /dev/null for async commands
1/13
----
execute_cmd.c
- HASH_BANG_BUFSIZE: use #define for size of buffer used in
READ_SAMPLE_BUF instead of straight constant 80
- HASH_BANG_BUFSIZ: increase to 128 because Linux allows 128 chars in
exec header. Reported by Ludovic Courtès <ludo@gnu.org>
configure.ac
- remove support for purify and purecoverage
- change release level to `rc1'
1/15
----
builtins/enable.def
- dyn_load_builtin: fix missing argument to builtin_error if load function
returns an error. Fix from Aharon Robbins <arnold@skeeve.com>
1/18
----
builtins/history.def
- histtime: display a better error message for invalid timestamps; use
existing `??' string for empty/missing timestamps or invalid history
entries. Suggestion from Reuben Thomas <rrt@sc3d.org>
+1
View File
@@ -963,6 +963,7 @@ tests/exec9.sub f
tests/exec10.sub f
tests/exec11.sub f
tests/exec12.sub f
tests/exec13.sub f
tests/exp.tests f
tests/exp.right f
tests/exp1.sub f
+2 -4
View File
@@ -89,10 +89,8 @@ TESTSCRIPT = @TESTSCRIPT@
DEBUGGER_START_FILE = @DEBUGGER_START_FILE@
#If you have purify, and want to use it, uncomment this definition or
# run the make as `make PURIFY=purify'
# or run configure with the --with-purify argument.
PURIFY = @PURIFY@
#If you have purify, and want to use it, run the make as `make PURIFY=purify'
#PURIFY = @PURIFY@
# Here is a rule for making .o files from .c files that does not
# force the type of the machine (like -M_MACHINE) into the flags.
+1 -1
View File
@@ -384,7 +384,7 @@ dyn_load_builtin (list, flags, filename)
r = (*loadfunc) (name);
if (r == 0)
{
builtin_error (_("load function for %s returns failure (%d): not loaded"), r);
builtin_error (_("load function for %s returns failure (%d): not loaded"), name, r);
free (funcname);
continue;
}
+3
View File
@@ -260,6 +260,9 @@ histtime (hlist, histtimefmt)
t = history_get_time (hlist);
if (t)
strftime (timestr, sizeof (timestr), histtimefmt, localtime (&t));
else if (hlist->timestamp && hlist->timestamp[0])
snprintf (timestr, sizeof (timestr), _("%s: invalid timestamp"),
(hlist->timestamp[0] == '#') ? hlist->timestamp + 1: hlist->timestamp);
else
strcpy (timestr, "??");
return timestr;
Vendored
+11 -43
View File
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac for Bash 4.4, version 4.076.
# From configure.ac for Bash 4.4, version 4.078.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for bash 4.4-beta.
# Generated by GNU Autoconf 2.69 for bash 4.4-rc1.
#
# Report bugs to <bug-bash@gnu.org>.
#
@@ -581,8 +581,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='bash'
PACKAGE_TARNAME='bash'
PACKAGE_VERSION='4.4-beta'
PACKAGE_STRING='bash 4.4-beta'
PACKAGE_VERSION='4.4-rc1'
PACKAGE_STRING='bash 4.4-rc1'
PACKAGE_BUGREPORT='bug-bash@gnu.org'
PACKAGE_URL=''
@@ -729,7 +729,6 @@ MALLOC_LIBRARY
MALLOC_LIB
MALLOC_SRC
MALLOC_TARGET
PURIFY
TESTSCRIPT
CPPFLAGS_FOR_BUILD
LDFLAGS_FOR_BUILD
@@ -790,8 +789,6 @@ with_bash_malloc
with_curses
with_gnu_malloc
with_installed_readline
with_purecov
with_purify
enable_minimal_config
enable_alias
enable_arith_for_command
@@ -1396,7 +1393,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures bash 4.4-beta to adapt to many kinds of systems.
\`configure' configures bash 4.4-rc1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1461,7 +1458,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of bash 4.4-beta:";;
short | recursive ) echo "Configuration of bash 4.4-rc1:";;
esac
cat <<\_ACEOF
@@ -1552,8 +1549,6 @@ Optional Packages:
--with-installed-readline
use a version of the readline library that is
already installed
--with-purecov configure to postprocess with pure coverage
--with-purify configure to postprocess with purify
--with-gnu-ld assume the C compiler uses GNU ld default=no
--with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
--without-libiconv-prefix don't search for libiconv in includedir and libdir
@@ -1656,7 +1651,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
bash configure 4.4-beta
bash configure 4.4-rc1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2365,7 +2360,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by bash $as_me 4.4-beta, which was
It was created by bash $as_me 4.4-rc1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2759,7 +2754,7 @@ ac_config_headers="$ac_config_headers config.h"
BASHVERS=4.4
RELSTATUS=beta
RELSTATUS=rc1
case "$RELSTATUS" in
alp*|bet*|dev*|rc*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
@@ -2840,8 +2835,6 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
opt_bash_malloc=yes
opt_purify=no
opt_purecov=no
opt_afs=no
opt_curses=no
opt_with_installed_readline=no
@@ -2917,18 +2910,6 @@ if test "${with_installed_readline+set}" = set; then :
fi
# Check whether --with-purecov was given.
if test "${with_purecov+set}" = set; then :
withval=$with_purecov; opt_purecov=$withval
fi
# Check whether --with-purify was given.
if test "${with_purify+set}" = set; then :
withval=$with_purify; opt_purify=$withval
fi
if test "$opt_bash_malloc" = yes; then
MALLOC_TARGET=malloc
MALLOC_SRC=malloc.c
@@ -2947,18 +2928,6 @@ else
MALLOC_DEP=
fi
if test "$opt_purify" = yes; then
PURIFY="purify "
$as_echo "#define DISABLE_MALLOC_WRAPPERS 1" >>confdefs.h
else
PURIFY=
fi
if test "$opt_purecov" = yes; then
PURIFY="${PURIFY}purecov"
fi
if test "$opt_afs" = yes; then
$as_echo "#define AFS 1" >>confdefs.h
@@ -3403,7 +3372,6 @@ fi
if test -z "$CFLAGS"; then
AUTO_CFLAGS="-g ${GCC+-O2} ${GCC+-Wno-parentheses}"
AUTO_LDFLAGS="-g ${GCC+-O2}"
@@ -16687,7 +16655,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by bash $as_me 4.4-beta, which was
This file was extended by bash $as_me 4.4-rc1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -16753,7 +16721,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
bash config.status 4.4-beta
bash config.status 4.4-rc1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
+2 -18
View File
@@ -21,10 +21,10 @@ dnl Process this file with autoconf to produce a configure script.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_REVISION([for Bash 4.4, version 4.076])dnl
AC_REVISION([for Bash 4.4, version 4.078])dnl
define(bashvers, 4.4)
define(relstatus, beta)
define(relstatus, rc1)
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
@@ -53,8 +53,6 @@ AC_CANONICAL_BUILD
dnl configure defaults
opt_bash_malloc=yes
opt_purify=no
opt_purecov=no
opt_afs=no
opt_curses=no
opt_with_installed_readline=no
@@ -113,8 +111,6 @@ AC_ARG_WITH(bash-malloc, AC_HELP_STRING([--with-bash-malloc], [use the Bash vers
AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval)
AC_ARG_WITH(gnu-malloc, AC_HELP_STRING([--with-gnu-malloc], [synonym for --with-bash-malloc]), opt_bash_malloc=$withval)
AC_ARG_WITH(installed-readline, AC_HELP_STRING([--with-installed-readline], [use a version of the readline library that is already installed]), opt_with_installed_readline=$withval)
AC_ARG_WITH(purecov, AC_HELP_STRING([--with-purecov], [configure to postprocess with pure coverage]), opt_purecov=$withval)
AC_ARG_WITH(purify, AC_HELP_STRING([--with-purify], [configure to postprocess with purify]), opt_purify=$withval)
if test "$opt_bash_malloc" = yes; then
MALLOC_TARGET=malloc
@@ -133,17 +129,6 @@ else
MALLOC_DEP=
fi
if test "$opt_purify" = yes; then
PURIFY="purify "
AC_DEFINE(DISABLE_MALLOC_WRAPPERS)
else
PURIFY=
fi
if test "$opt_purecov" = yes; then
PURIFY="${PURIFY}purecov"
fi
if test "$opt_afs" = yes; then
AC_DEFINE(AFS)
fi
@@ -391,7 +376,6 @@ fi
dnl now substitute in the values generated by arguments
AC_SUBST(TESTSCRIPT)
AC_SUBST(PURIFY)
AC_SUBST(MALLOC_TARGET)
AC_SUBST(MALLOC_SRC)
+2 -2
View File
@@ -4729,8 +4729,8 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS
tory file, marked with the history comment character. When the
history file is read, lines beginning with the history comment
character followed immediately by a digit are interpreted as
timestamps for the previous history line. The return value is 0
unless an invalid option is encountered, an error occurs while
timestamps for the following history entry. The return value is
0 unless an invalid option is encountered, an error occurs while
reading or writing the history file, an invalid _o_f_f_s_e_t is sup-
plied as an argument to --dd, or the history expansion supplied as
an argument to --pp fails.
+1 -1
View File
@@ -909,7 +909,7 @@ last command executed, or zero if no condition tested true.
The \fBwhile\fP command continuously executes the list
\fIlist-2\fP as long as the last command in the list \fIlist-1\fP returns
an exit status of zero. The \fBuntil\fP command is identical
to the \fBwhile\fP command, except that the test is negated;
to the \fBwhile\fP command, except that the test is negated:
.I list-2
is executed as long as the last command in
.I list-1
+16 -5
View File
@@ -619,7 +619,7 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
if (paren_pid == 0)
{
/* We want to run the exit trap for forced {} subshells, and we
want to note this before execute_in_subshell[B modifies the
want to note this before execute_in_subshell modifies the
COMMAND struct. Need to keep in mind that execute_in_subshell
runs the exit trap for () subshells itself. */
/* This handles { command; } & */
@@ -1544,14 +1544,19 @@ execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close)
/* If this is a user subshell, set a flag if stdin was redirected.
This is used later to decide whether to redirect fd 0 to
/dev/null for async commands in the subshell. This adds more
sh compatibility, but I'm not sure it's the right thing to do. */
sh compatibility, but I'm not sure it's the right thing to do.
Note that an input pipe to a compound command suffices to inhibit
the implicit /dev/null redirection for asynchronous commands
executed as part of that compound command. */
if (user_subshell)
{
stdin_redir = stdin_redirects (command->redirects);
stdin_redir = stdin_redirects (command->redirects) || pipe_in != NO_PIPE;
#if 0
restore_default_signal (EXIT_TRAP); /* XXX - reset_signal_handlers above */
#endif
}
else if (shell_control_structure (command->type) && pipe_in != NO_PIPE)
stdin_redir = 1;
/* If this is an asynchronous command (command &), we want to
redirect the standard input from /dev/null in the absence of
@@ -4031,6 +4036,10 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
if (fds_to_close)
close_fd_bitmap (fds_to_close);
/* If we fork because of an input pipe, note input pipe for later to
inhibit async commands from redirecting stdin from /dev/null */
stdin_redir |= pipe_in != NO_PIPE;
do_piping (pipe_in, pipe_out);
pipe_in = pipe_out = NO_PIPE;
#if defined (COPROCESS_SUPPORT)
@@ -5349,13 +5358,15 @@ initialize_subshell ()
# define SETOSTYPE(x)
#endif
#define HASH_BANG_BUFSIZ 128
#define READ_SAMPLE_BUF(file, buf, len) \
do \
{ \
fd = open(file, O_RDONLY); \
if (fd >= 0) \
{ \
len = read (fd, buf, 80); \
len = read (fd, buf, HASH_BANG_BUFSIZ); \
close (fd); \
} \
else \
@@ -5371,7 +5382,7 @@ shell_execve (command, args, env)
char **args, **env;
{
int larray, i, fd;
char sample[80];
char sample[HASH_BANG_BUFSIZ];
int sample_len;
SETOSTYPE (0); /* Some systems use for USG/POSIX semantics */
+1 -1
View File
@@ -110,7 +110,7 @@ _print_malloc_stats (s, fp)
}
fprintf (fp, "\nTotal bytes in use: %lu, total bytes free: %lu\n",
totused, totfree);
fprintf (fp, "\nTotal bytes requested by application: %lu\n", _mstats.bytesreq);
fprintf (fp, "\nTotal bytes requested by application: %lu\n", (unsigned long)_mstats.bytesreq);
fprintf (fp, "Total mallocs: %d, total frees: %d, total reallocs: %d (%d copies)\n",
_mstats.nmal, _mstats.nfre, _mstats.nrealloc, _mstats.nrcopy);
fprintf (fp, "Total sbrks: %d, total bytes via sbrk: %d\n",
+1 -1
View File
@@ -290,7 +290,7 @@ _register_dump_table(fp)
{
entry = mem_table[i];
if (entry.mem)
fprintf (fp, "%s[%d] %p:%d:%s:%s:%s:%d:%d:%d\n",
fprintf (fp, "%s[%d] %p:%zu:%s:%s:%s:%d:%d:%d\n",
(i == table_bucket_index) ? "*" : "",
i,
entry.mem, entry.size,
+2 -2
View File
@@ -52,10 +52,10 @@ mtrace_alloc (tag, mem, size, file, line)
_mtrace_fp = stderr;
if (_mtrace_verbose)
fprintf (_mtrace_fp, "alloc: %s: %p (%d bytes) from '%s:%d'\n",
fprintf (_mtrace_fp, "alloc: %s: %p (%zu bytes) from '%s:%d'\n",
tag, mem, size, file ? file : "unknown", line);
else
fprintf (_mtrace_fp, "alloc:%p:%d:%s:%d\n",
fprintf (_mtrace_fp, "alloc:%p:%zu:%s:%d\n",
mem, size, file ? file : "unknown", line);
}
+1
View File
@@ -242,6 +242,7 @@ is greater than the history length, return a @code{NULL} pointer.
@deftypefun time_t history_get_time (HIST_ENTRY *entry)
Return the time stamp associated with the history entry @var{entry}.
If the timestamp is missing or invalid, return 0.
@end deftypefun
@deftypefun int history_total_bytes (void)
+3 -3
View File
@@ -475,7 +475,7 @@ history_truncate_file (fname, lines)
int lines;
{
char *buffer, *filename, *tempname, *bp, *bp1; /* bp1 == bp+1 */
int file, chars_read, rv, orig_lines, exists;
int file, chars_read, rv, orig_lines, exists, r;
struct stat finfo;
size_t file_size;
@@ -611,7 +611,7 @@ history_truncate_file (fname, lines)
with a shared history file, we don't want to leave the history file
owned by root. */
if (rv == 0 && exists)
chown (filename, finfo.st_uid, finfo.st_gid);
r = chown (filename, finfo.st_uid, finfo.st_gid);
xfree (filename);
FREE (tempname);
@@ -758,7 +758,7 @@ mmap_error:
with a shared history file, we don't want to leave the history file
owned by root. */
if (rv == 0 && exists)
chown (histname, finfo.st_uid, finfo.st_gid);
mode = chown (histname, finfo.st_uid, finfo.st_gid);
FREE (histname);
FREE (tempname);
+1 -1
View File
@@ -2312,7 +2312,7 @@ shell_getc (remove_quoted_newline)
if (n <= 2) /* we have to save 1 for the newline added below */
{
if (truncating == 0)
internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, SIZE_MAX);
internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, (unsigned long)SIZE_MAX);
shell_input_line[i] = '\0';
truncating = 1;
}
+2
View File
@@ -5694,6 +5694,8 @@ process_substitute (string, open_for_read_in_child)
stop_making_children ();
/* XXX - should we only do this in the parent? (as in command subst) */
pipeline_pgrp = old_pipeline_pgrp;
#else
stop_making_children ();
#endif /* JOB_CONTROL */
if (pid < 0)
+8
View File
@@ -97,3 +97,11 @@ d
c
d
e
x1
x1a
x2
x2a
x2b
x3
x3a
x3b
+21
View File
@@ -0,0 +1,21 @@
echo x1 | ( cat & wait )
echo x1a | ( :& cat & wait )
echo x2 | for f in 1; do
cat & wait
done
echo x2a | if true; then cat & wait; fi
echo x2b | for (( i=0; i < 1; i++ )) ; do cat & wait; done
echo x3 | { cat & wait; }
lambda() { cat & wait; }
echo x3a | lambda
: ${TMPDIR:=/tmp}
SRCF=$TMPDIR/bash-src-$$
cat > $SRCF << \EOF
cat & wait
EOF
echo x3b | . $SRCF
rm -f $SRCF
+2
View File
@@ -155,3 +155,5 @@ $THIS_SH -c 'echo A && /bin/echo B'
$THIS_SH -c '/bin/echo c && echo d'
$THIS_SH -c '/bin/echo c && /bin/echo d && echo e'
${THIS_SH} ./exec13.sub