commit bash-20150417 snapshot

This commit is contained in:
Chet Ramey
2015-05-15 11:03:36 -04:00
parent 1a088fee73
commit 85ec0778f9
24 changed files with 3491 additions and 70 deletions
-2
View File
@@ -1,2 +0,0 @@
# don't push out -i
-i
+41 -2
View File
@@ -8298,8 +8298,47 @@ builtins/source.def
Fixes bug reported by Scott Bronson <bronson@rinspin.com>
builtins/evalstring.c
- parse_string: before we jump to top_level, if we are at the `bottom' of
the parse_and_execute stack (parse_and_execute_level == 0), call
- parse_string: before we jump to top_level, if we are at the `bottom'
of the parse_and_execute stack (parse_and_execute_level == 0), call
top_level_cleanup() before jumping so the right cleanup happens (e.g.,
cleaning up redirections and other state). Fixes bug reported by
Sam Liddicott <sam@liddicott.com>
4/15
----
jobs.c
- delete_job: only add J_ASYNC (and not J_FOREGROUND) jobs to the
bgpids array, since Posix says shells only need to save the status
of async jobs. Report and fix from John Fremlin <john@fb.com>
4/17
----
pcomplib.c
- COMPLETE_HASH_BUCKETS: increase to 256 since bash-completion is
over 300 completions by now
variables.c
- VARIABLES_HASH_BUCKETS: constant used to size shell variables hash
table instead of relying on hash library default. Used in calls
to hash_create in create_variable_tables(), push_temp_var(), and
push_func_var(). Currently set to 1024 because why not? From a
discussion starting at
https://lists.gnu.org/archive/html/bug-bash/2015-04/msg00089.html
- initialize_shell_variables: if FUNCTION_IMPORT is not defined, the
nested conditional compilation causes syntax errors. Bug and fix
from Eric Blake <eblake@redhat.com>
configure.ac
- function-import: fix typo, assign to correct variable. Found as the
result of a report by Eric Blake <eblake@redhat.com>
shell.c
- open_shell_script: check whether or not file argument is a
directory before opening; Posix says that implementations may open
a directory with O_RDONLY. Bug report from
Eduardo A. Bustamante López <dualbus@gmail.com>
4/19
----
ulimit.def
- fix typo in limits[] declaration of `k'
+1
View File
@@ -796,6 +796,7 @@ examples/misc/aliasconv.bash f
examples/misc/cshtobash f
tests/README f
tests/COPYRIGHT f
tests/test-glue-functions f
tests/alias.tests f
tests/alias1.sub f
tests/alias.right f
+1 -1
View File
@@ -254,7 +254,7 @@ static RESOURCE_LIMITS limits[] = {
{ 'i', RLIMIT_SIGPENDING, 1, "pending signals", (char *)NULL },
#endif
#ifdef RLIMIT_KQUEUES
{ 'k', RLIMIT_KQUEUES, 1, "max kqueues", (char *)NULL" },
{ 'k', RLIMIT_KQUEUES, 1, "max kqueues", (char *)NULL },
#endif
#ifdef RLIMIT_MEMLOCK
{ 'l', RLIMIT_MEMLOCK, 1024, "max locked memory", "kbytes" },
Vendored
+5 -5
View File
@@ -1,5 +1,5 @@
#! /bin/sh
# From configure.ac for Bash 4.4, version 4.067.
# From configure.ac for Bash 4.4, version 4.068.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for bash 4.4-devel.
#
@@ -809,7 +809,7 @@ enable_disabled_builtins
enable_dparen_arithmetic
enable_extended_glob
enable_extended_glob_default
enable_funtion_import
enable_function_import
enable_glob_asciiranges_default
enable_help_builtin
enable_history
@@ -3120,9 +3120,9 @@ if test "${enable_extended_glob_default+set}" = set; then :
enableval=$enable_extended_glob_default; opt_extglob_default=$enableval
fi
# Check whether --enable-funtion-import was given.
if test "${enable_funtion_import+set}" = set; then :
enableval=$enable_funtion_import; opt_extglob_default=$enableval
# Check whether --enable-function-import was given.
if test "${enable_function_import+set}" = set; then :
enableval=$enable_function_import; opt_function_import=$enableval
fi
# Check whether --enable-glob-asciiranges-default was given.
+2 -2
View File
@@ -21,7 +21,7 @@ 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.067])dnl
AC_REVISION([for Bash 4.4, version 4.068])dnl
define(bashvers, 4.4)
define(relstatus, devel)
@@ -235,7 +235,7 @@ AC_ARG_ENABLE(disabled-builtins, AC_HELP_STRING([--enable-disabled-builtins], [a
AC_ARG_ENABLE(dparen-arithmetic, AC_HELP_STRING([--enable-dparen-arithmetic], [include ((...)) command]), opt_dparen_arith=$enableval)
AC_ARG_ENABLE(extended-glob, AC_HELP_STRING([--enable-extended-glob], [include ksh-style extended pattern matching]), opt_extended_glob=$enableval)
AC_ARG_ENABLE(extended-glob-default, AC_HELP_STRING([--enable-extended-glob-default], [force extended pattern matching to be enabled by default]), opt_extglob_default=$enableval)
AC_ARG_ENABLE(funtion-import, AC_HELP_STRING([--enable-function-import], [allow bash to import exported function definitions by default]), opt_extglob_default=$enableval)
AC_ARG_ENABLE(function-import, AC_HELP_STRING([--enable-function-import], [allow bash to import exported function definitions by default]), opt_function_import=$enableval)
AC_ARG_ENABLE(glob-asciiranges-default, AC_HELP_STRING([--enable-glob-asciiranges-default], [force bracket range expressions in pattern matching to use the C locale by default]), opt_globascii_default=$enableval)
AC_ARG_ENABLE(help-builtin, AC_HELP_STRING([--enable-help-builtin], [include the help builtin]), opt_help=$enableval)
AC_ARG_ENABLE(history, AC_HELP_STRING([--enable-history], [turn on command history]), opt_history=$enableval)
+1 -1
View File
@@ -178,7 +178,7 @@ executable_file (file)
int s;
s = file_status (file);
#if defined EISDIR
#if defined (EISDIR)
if (s & FS_DIRECTORY)
errno = EISDIR; /* let's see if we can improve error messages */
#endif
+1 -2
View File
@@ -1043,10 +1043,9 @@ delete_job (job_index, dflags)
if (temp == 0)
return;
if ((dflags & DEL_NOBGPID) == 0)
if ((dflags & DEL_NOBGPID) == 0 && (temp->flags & (J_ASYNC|J_FOREGROUND)) == J_ASYNC)
{
proc = find_last_proc (job_index, 0);
/* Could do this just for J_ASYNC jobs, but we save all. */
if (proc)
bgp_add (proc->pid, process_exit_status (proc->status));
}
+39
View File
@@ -0,0 +1,39 @@
#if defined (READLINE_AUTOCOMPLETE)
/* Return the list of completions for the text between START and END.
FOUND_QUOTE is non-zero if we're completing a quoted word; if so,
QUOTE_CHAR is the delimiter. If NONTRIVIAL_P is nonzero, it gets
set to a flag saying whether or not the completion added anything
to the word. Not part of rl_complete_internal because it's too
hard to separate functions without postprocess_matches possibly being
called twice; here to support the autocompletion code. */
char **
_rl_generate_completions (start, end, found_quote, quote_char, nontrivial_p)
int start, end, found_quote, quote_char, *nontrivial_p;
{
rl_compentry_func_t *our_func;
char *text;
char **matches;
our_func = rl_completion_entry_function
? rl_completion_entry_function
: rl_filename_completion_function;
text = rl_copy_text (start, end);
matches = gen_completion_matches (text, start, end, our_func, found_quote, quote_char);
/* *nontrivial_p is set if the common prefix adds something to the word
being completed. */
if (nontrivial_p)
*nontrivial_p = matches && strcmp (text, matches[0]) != 0;
free (text);
/* Postprocess the matches */
if (matches == 0)
return (char **)0;
if (postprocess_matches (&matches, rl_filename_completion_desired) == 0)
return (char **)0;
return 0;
}
#endif
+9 -5
View File
@@ -442,11 +442,15 @@ a \fBNULL\fP pointer.
.Fn1 "HIST_ENTRY *" next_history "void"
If the current history offset is not already at the end of the history
list, move the current history offset forward to the next history entry,
and return the a pointer to that entry.
If there is no next entry, return a \fBNULL\fP pointer.
If this function returns \fBNULL\fP, the current history offset is at the
end of the history list.
list, move the current history offset forward to the next history entry.
If the incremented history offset refers to a valid history entry, return
a pointer to that entry.
If there is no next entry, as when the history offset before being
incremented refers to the last valid entry in the history list, return
a \fBNULL\fP pointer.
If this function returns \fBNULL\fP, the current history offset when the
function returns (possibly incremented as described above)
is at the end of the history list.
.SS Searching the History List
+9 -5
View File
@@ -271,11 +271,15 @@ a @code{NULL} pointer.
@deftypefun {HIST_ENTRY *} next_history (void)
If the current history offset is not already at the end of the history
list, move the current history offset forward to the next history entry,
and return the a pointer to that entry.
If there is no next entry, return a @code{NULL} pointer.
If this function returns @code{NULL}, the current history offset is at the
end of the history list.
list, move the current history offset forward to the next history entry.
If the incremented history offset refers to a valid history entry, return
a pointer to that entry.
If there is no next entry, as when the history offset before being
incremented refers to the last valid entry in the history list, return
a @code{NULL} pointer.
If this function returns @code{NULL}, the current history offset when the
function returns (possibly incremented as described above)
is at the end of the history list.
@end deftypefun
@node Searching the History List
+2 -2
View File
@@ -141,7 +141,7 @@ sh_modcase (string, pat, flags)
inword = 0;
while (start < end)
{
wc = cval (string, start);
wc = cval ((char *)string, start);
if (iswalnum (wc) == 0)
inword = 0;
@@ -150,7 +150,7 @@ sh_modcase (string, pat, flags)
{
next = start;
ADVANCE_CHAR (string, end, next);
s = substring (string, start, next);
s = substring ((char *)string, start, next);
match = strmatch (pat, s, FNM_EXTMATCH) != FNM_NOMATCH;
free (s);
if (match == 0)
+1 -1
View File
@@ -37,7 +37,7 @@
#include "shell.h"
#include "pcomplete.h"
#define COMPLETE_HASH_BUCKETS 128 /* must be power of two */
#define COMPLETE_HASH_BUCKETS 256 /* must be power of two */
#define STRDUP(x) ((x) ? savestring (x) : (char *)NULL)
+11
View File
@@ -1470,6 +1470,17 @@ open_shell_script (script_name)
exit ((e == ENOENT) ? EX_NOTFOUND : EX_NOINPUT);
}
if (file_isdir (filename))
{
#if defined (EISDIR)
errno = EISDIR;
#else
errno = EINVAL;
#endif
file_error (filename);
exit (EX_NOINPUT);
}
free (dollar_vars[0]);
dollar_vars[0] = exec_argv0 ? savestring (exec_argv0) : savestring (script_name);
if (exec_argv0)
+1530
View File
File diff suppressed because it is too large Load Diff
+1779
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,4 +1,4 @@
BUILD_DIR=/usr/local/build/chet/bash/bash-current
BUILD_DIR=/usr/local/build/bash/bash-current
THIS_SH=$BUILD_DIR/bash
PATH=$PATH:$BUILD_DIR
+15 -15
View File
@@ -19,36 +19,36 @@ aéb
1,0000
1
bytematch
0000000 254 012
0000000 254 012
0000002
Passed all 1378 Unicode tests
0000000 303 277 012
0000000 303 277 012
0000003
0000000 303 277 012
0000000 303 277 012
0000003
0000000 303 277 012
0000000 303 277 012
0000003
0000000 303 277 012
0000000 303 277 012
0000003
0000000 357 277 277 012
0000000 357 277 277 012
0000004
0000000 357 277 277 012
0000000 357 277 277 012
0000004
0000000 012
0000000 012
0000001
0000000 012
0000000 012
0000001
0000000 012
0000000 012
0000001
0000000 012
0000000 012
0000001
0000000 303 277 012
0000000 303 277 012
0000003
0000000 303 277 012
0000000 303 277 012
0000003
0000000 303 277 012
0000000 303 277 012
0000003
0000000 101 040 302 243 040 305 222 012
0000000 101 040 302 243 040 305 222 012
0000010
./unicode3.sub: line 2: 5作3+齷8叚窸: command not found
5作3+齷8叚窸
+4 -2
View File
@@ -35,8 +35,10 @@ esac
set a b
printf '%s\n' "$*"
# squeeze out blanks to avoid white space differences in od implementations
printf '%s' "$*" | od -b | ( IFS=$' \t\n' ; while read line; do echo $line; done; )
. ./test-glue-functions
printf '%s' "$*" | od -b | _intl_normalize_spaces
# display differences make this problematic
${THIS_SH} ./intl1.sub
+3 -1
View File
@@ -1,3 +1,5 @@
. ./test-glue-functions
# more tests to make sure that IFS splits on characters, not bytes
export LANG=en_US.UTF-8
@@ -18,4 +20,4 @@ case $euro in
*) echo mbchar match ;;
esac
echo "${euro##*$o202}" | od -b
echo "${euro##*$o202}" | od -b | _intl_normalize_spaces
+1 -1
View File
@@ -3,6 +3,6 @@
echo "warning: some of these tests will fail if you do not have UTF-8" >&2
echo "warning: locales installed on your system." >&2
echo "warning: please ignore any differences consisting only of white space" >&2
${THIS_SH} ./intl.tests > /tmp/xx
diff $AFLAG /tmp/xx intl.right && rm -f /tmp/xx
+9
View File
@@ -0,0 +1,9 @@
# shell functions to include in multiple test files
# squeeze out blanks to avoid white space differences in od implementations
_intl_normalize_spaces()
{
sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/[[:space:]]*$//'
}
+16 -14
View File
@@ -1,22 +1,24 @@
. ./test-glue-functions
export LANG=en_US.UTF-8
printf '%s\n' "$(printf '\uff')" | od -b
printf '%s\n' $'\uff' | od -b
printf '%s\n' "$(printf '\uff')" | od -b | _intl_normalize_spaces
printf '%s\n' $'\uff' | od -b | _intl_normalize_spaces
printf '\uff'\\n | od -b
echo $'\uff' | od -b
printf '\uff'\\n | od -b | _intl_normalize_spaces
echo $'\uff' | od -b | _intl_normalize_spaces
printf '\uffff'\\n | od -b
echo $'\uffff' | od -b
printf '\uffff'\\n | od -b | _intl_normalize_spaces
echo $'\uffff' | od -b | _intl_normalize_spaces
printf '\Ufffffffe'\\n | od -b
echo $'\Ufffffffe' | od -b
printf '\Ufffffffe'\\n | od -b | _intl_normalize_spaces
echo $'\Ufffffffe' | od -b | _intl_normalize_spaces
printf '\Uffffffff'\\n | od -b
echo $'\Uffffffff' | od -b
printf '\Uffffffff'\\n | od -b | _intl_normalize_spaces
echo $'\Uffffffff' | od -b | _intl_normalize_spaces
LC_CTYPE=C printf '\uff'\\n | od -b
LC_CTYPE=ru_RU.CP1251 printf '\uff'\\n | od -b
LC_CTYPE=en_US.UTF-8 printf '\uff'\\n | od -b
LC_CTYPE=C printf '\uff'\\n | od -b | _intl_normalize_spaces
LC_CTYPE=ru_RU.CP1251 printf '\uff'\\n | od -b | _intl_normalize_spaces
LC_CTYPE=en_US.UTF-8 printf '\uff'\\n | od -b | _intl_normalize_spaces
echo -e '\u0041 \u00a3 \u0152' | od -b
echo -e '\u0041 \u00a3 \u0152' | od -b | _intl_normalize_spaces
+10 -8
View File
@@ -79,6 +79,7 @@
# include "pcomplete.h"
#endif
#define VARIABLES_HASH_BUCKETS 1024 /* must be power of two */
#define TEMPENV_HASH_BUCKETS 4 /* must be power of two */
#define ifsname(s) ((s)[0] == 'I' && (s)[1] == 'F' && (s)[2] == 'S' && (s)[3] == '\0')
@@ -310,7 +311,7 @@ create_variable_tables ()
{
shell_variables = global_variables = new_var_context ((char *)NULL, 0);
shell_variables->scope = 0;
shell_variables->table = hash_create (0);
shell_variables->table = hash_create (VARIABLES_HASH_BUCKETS);
}
if (shell_functions == 0)
@@ -407,22 +408,23 @@ initialize_shell_variables (env, privmode)
/* Restore original suffix */
tname[namelen] = BASHFUNC_SUFFIX[0];
}
else
#endif /* FUNCTION_IMPORT */
#if defined (ARRAY_VARS)
# if ARRAY_EXPORT
/* Array variables may not yet be exported. */
else if (*string == '(' && string[1] == '[' && string[strlen (string) - 1] == ')')
if (*string == '(' && string[1] == '[' && string[strlen (string) - 1] == ')')
{
string_length = 1;
temp_string = extract_array_assignment_list (string, &string_length);
temp_var = assign_array_from_string (name, temp_string);
temp_var = assign_array_from_string (name, temp_string, 0);
FREE (temp_string);
VSETATTR (temp_var, (att_exported | att_imported));
array_needs_making = 1;
}
else
# endif /* ARRAY_EXPORT */
#endif
else
{
ro = 0;
if (posixly_correct && STREQ (name, "SHELLOPTS"))
@@ -3837,7 +3839,7 @@ push_temp_var (data)
{
if (shell_variables == global_variables)
/* shouldn't happen */
binding_table = shell_variables->table = global_variables->table = hash_create (0);
binding_table = shell_variables->table = global_variables->table = hash_create (VARIABLES_HASH_BUCKETS);
else
binding_table = shell_variables->table = hash_create (TEMPENV_HASH_BUCKETS);
}
@@ -4053,13 +4055,13 @@ make_env_array_from_var_list (vars)
#if defined (ARRAY_VARS)
else if (array_p (var))
# if ARRAY_EXPORT
value = array_to_assignment_string (array_cell (var));
value = array_to_assign (array_cell (var), 0);
# else
continue; /* XXX array vars cannot yet be exported */
# endif /* ARRAY_EXPORT */
else if (assoc_p (var))
# if 0
value = assoc_to_assignment_string (assoc_cell (var));
value = assoc_to_assign (assoc_cell (var), 0);
# else
continue; /* XXX associative array vars cannot yet be exported */
# endif
@@ -4431,7 +4433,7 @@ push_func_var (data)
being propagated down to the global variables table. Create one if
we have to */
if ((vc_isfuncenv (shell_variables) || vc_istempenv (shell_variables)) && shell_variables->table == 0)
shell_variables->table = hash_create (0);
shell_variables->table = hash_create (VARIABLES_HASH_BUCKETS);
/* XXX - should we set v->context here? */
v = bind_variable_internal (var->name, value_cell (var), shell_variables->table, 0, 0);
if (shell_variables == global_variables)