commit bash-20181205 snapshot

This commit is contained in:
Chet Ramey
2018-12-06 08:53:51 -05:00
parent 0712a90cd8
commit 3669b0bacc
13 changed files with 1968 additions and 3619 deletions
+29
View File
@@ -4801,3 +4801,32 @@ execute_cmd.c
lib/readline/doc/rltech.texi
- rl_set_keymap_name: correct typo in the name; some updates to the
description that clarify usage. Report from <hirooih@gmail.com>
12/4
----
aclocal.m4
- BASH_FUNC_FNMATCH_EQUIV_FALLBACK: a test of whether fnmatch(3)
understands bracket equivalence classes ([=c=]) for characters
that collate with equal weights but are not identical
configure.ac,config.h.in
- call BASH_FUNC_FNMATCH_EQUIV_FALLBACK and define
FNMATCH_EQUIV_FALLBACK to 1 if it can be used for equivalence
classes
12/5
----
execute_cmd.c
- eval_arith_for_expr,execute_arith_command,execute_cond_command: make
sure running_trap == 0 before we reset the_printed_command_except_trap
Report from Peng Yu <pengyu.ut@gmail.com>
lib/glob/smatch.c
- _fnmatch_fallback_wc: new function, takes two wide characters c1 and
c2, converts them to a pattern ([[=c2=]]) and a string (c1) for
fnmatch to determine whether or not they are members of the same
equivalence class
- collequiv_wc: call _fnmatch_fallback_wc if rangecmp_wc returns
non-zero if FNMATCH_EQUIV_FALLBACK is defined, so we know that
fnmatch understands equivalence classes. Another Posix test suite
issue from Martin Rehak <martin.rehak@oracle.com>
Vendored
+37
View File
@@ -4223,3 +4223,40 @@ main(int c, char **v)
[Define if you have a working sbrk function.])
fi
])
AC_DEFUN(BASH_FUNC_FNMATCH_EQUIV_FALLBACK,
[AC_MSG_CHECKING(whether fnmatch can be used to check bracket equivalence classes)
AC_CACHE_VAL(bash_cv_fnmatch_equiv_fallback,
[AC_TRY_RUN([
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <fnmatch.h>
#include <locale.h>
char *pattern = "[[=a=]]";
/* char *string = "ä"; */
unsigned char string[4] = { '\xc3', '\xa4', '\0' };
int
main (int c, char **v)
{
setlocale (LC_ALL, "de_DE.UTF-8");
if (fnmatch (pattern, (const char *)string, 0) != FNM_NOMATCH)
exit (0);
exit (1);
}
], bash_cv_fnmatch_equiv_fallback=yes, bash_cv_fnmatch_equiv_fallback=no,
[AC_MSG_WARN(cannot check fnmatch if cross compiling -- defaulting to no)
bash_cv_fnmatch_equiv_fallback=no]
)])
AC_MSG_RESULT($bash_cv_fnmatch_equiv_fallback)
if test "$bash_cv_fnmatch_equiv_fallback" = "yes" ; then
bash_cv_fnmatch_equiv_value=1
else
bash_cv_fnmatch_equiv_value=0
fi
AC_DEFINE_UNQUOTED([FNMATCH_EQUIV_FALLBACK], [$bash_cv_fnmatch_equiv_value], [Whether fnmatch can be used for bracket equivalence classes])
])
+3
View File
@@ -612,6 +612,9 @@
/* Define if you have the fnmatch function. */
#undef HAVE_FNMATCH
/* Can fnmatch be used as a fallback to match [=equiv=] with collation weights? */
#undef FNMATCH_EQUIV_FALLBACK
/* Define if you have the fpurge/__fpurge function. */
#undef HAVE_FPURGE
#undef HAVE___FPURGE
Vendored
+62 -1
View File
@@ -1,5 +1,5 @@
#! /bin/sh
# From configure.ac for Bash 5.0, version 5.003.
# From configure.ac for Bash 5.0, version 5.004.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for bash 5.0-beta2.
#
@@ -15275,6 +15275,67 @@ $as_echo "#define HAVE_PRINTF_A_FORMAT 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fnmatch can be used to check bracket equivalence classes" >&5
$as_echo_n "checking whether fnmatch can be used to check bracket equivalence classes... " >&6; }
if ${bash_cv_fnmatch_equiv_fallback+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check fnmatch if cross compiling -- defaulting to no" >&5
$as_echo "$as_me: WARNING: cannot check fnmatch if cross compiling -- defaulting to no" >&2;}
bash_cv_fnmatch_equiv_fallback=no
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <fnmatch.h>
#include <locale.h>
char *pattern = "[[=a=]]";
/* char *string = "ä"; */
unsigned char string[4] = { '\xc3', '\xa4', '\0' };
int
main (int c, char **v)
{
setlocale (LC_ALL, "de_DE.UTF-8");
if (fnmatch (pattern, (const char *)string, 0) != FNM_NOMATCH)
exit (0);
exit (1);
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
bash_cv_fnmatch_equiv_fallback=yes
else
bash_cv_fnmatch_equiv_fallback=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_fnmatch_equiv_fallback" >&5
$as_echo "$bash_cv_fnmatch_equiv_fallback" >&6; }
if test "$bash_cv_fnmatch_equiv_fallback" = "yes" ; then
bash_cv_fnmatch_equiv_value=1
else
bash_cv_fnmatch_equiv_value=0
fi
cat >>confdefs.h <<_ACEOF
#define FNMATCH_EQUIV_FALLBACK $bash_cv_fnmatch_equiv_value
_ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if signal handlers must be reinstalled when invoked" >&5
+3 -1
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 5.0, version 5.003])dnl
AC_REVISION([for Bash 5.0, version 5.004])dnl
define(bashvers, 5.0)
define(relstatus, beta2)
@@ -1030,6 +1030,8 @@ fi
BASH_FUNC_PRINTF_A_FORMAT
BASH_FUNC_FNMATCH_EQUIV_FALLBACK
dnl presence and behavior of OS functions
BASH_SYS_REINSTALL_SIGHANDLERS
BASH_SYS_JOB_CONTROL_MISSING
+4 -4
View File
@@ -1616,7 +1616,7 @@ execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close)
async_redirect_stdin ();
#if 0
/* XXX - TAG: bash-5.1 */
/* XXX - TAG:bash-5.1 */
if (user_subshell && command->type == cm_subshell)
optimize_subshell_command (command->value.Subshell->command);
#endif
@@ -2985,7 +2985,7 @@ eval_arith_for_expr (l, okp)
command_string_index = 0;
print_arith_command (new);
if (signal_in_progress (DEBUG_TRAP) == 0)
if (signal_in_progress (DEBUG_TRAP) == 0 && running_trap == 0)
{
FREE (the_printed_command_except_trap);
the_printed_command_except_trap = savestring (the_printed_command);
@@ -3717,7 +3717,7 @@ execute_arith_command (arith_command)
command_string_index = 0;
print_arith_command (arith_command->exp);
if (signal_in_progress (DEBUG_TRAP) == 0)
if (signal_in_progress (DEBUG_TRAP) == 0 && running_trap == 0)
{
FREE (the_printed_command_except_trap);
the_printed_command_except_trap = savestring (the_printed_command);
@@ -3918,7 +3918,7 @@ execute_cond_command (cond_command)
command_string_index = 0;
print_cond_command (cond_command);
if (signal_in_progress (DEBUG_TRAP) == 0)
if (signal_in_progress (DEBUG_TRAP) == 0 && running_trap == 0)
{
FREE (the_printed_command_except_trap);
the_printed_command_except_trap = savestring (the_printed_command);
+8 -8
View File
@@ -4073,20 +4073,20 @@ notify_of_job_status ()
((DEADJOB (job) && IS_FOREGROUND (job) == 0) || STOPPED (job)))
continue;
#if 0
/* If job control is disabled, don't print the status messages.
Mark dead jobs as notified so that they get cleaned up. If
startup_state == 2, we were started to run `-c command', so
don't print anything. */
if ((job_control == 0 && interactive_shell) || startup_state == 2)
#else
/* If job control is disabled, don't print the status messages.
Mark dead jobs as notified so that they get cleaned up. If
startup_state == 2 and subshell_environment has the
SUBSHELL_COMSUB bit turned on, we were started to run a command
substitution, so don't print anything. */
substitution, so don't print anything.
Otherwise, if the shell is not interactive, POSIX says that `jobs'
is the only way to notify of job status. */
#if 1
if ((job_control == 0 && interactive_shell) ||
(startup_state == 2 && (subshell_environment & SUBSHELL_COMSUB)))
#else /* TAG:bash-5.1 */
if ((job_control == 0 && interactive_shell) ||
(startup_state == 2 && (subshell_environment & SUBSHELL_COMSUB)) ||
(startup_state == 2 && posixly_correct && (subshell_environment & SUBSHELL_COMSUB) == 0))
#endif
{
/* POSIX.2 compatibility: if the shell is not interactive,
+50 -3
View File
@@ -288,6 +288,37 @@ is_cclass (c, name)
extern char *mbsmbchar __P((const char *));
#if FNMATCH_EQUIV_FALLBACK
/* Construct a string w1 = "c1" and a pattern w2 = "[[=c2=]]" and pass them
to fnmatch to see if wide characters c1 and c2 collate as members of the
same equivalence class. We can't really do this portably any other way */
static int
_fnmatch_fallback_wc (c1, c2)
wchar_t c1, c2; /* string char, patchar */
{
char w1[MB_LEN_MAX+1]; /* string */
char w2[MB_LEN_MAX+8]; /* constructed pattern */
int l1, l2;
l1 = wctomb (w1, c1);
if (l1 == -1)
return (2);
w1[l1] = '\0';
/* reconstruct the pattern */
w2[0] = w2[1] = '[';
w2[2] = '=';
l2 = wctomb (w2+3, c2);
if (l2 == -1)
return (2);
w2[l2+3] = '=';
w2[l2+4] = w2[l2+5] = ']';
w2[l2+6] = '\0';
return (fnmatch ((const char *)w2, (const char *)w1, 0));
}
#endif
static int
rangecmp_wc (c1, c2, forcecoll)
wint_t c1, c2;
@@ -306,9 +337,10 @@ rangecmp_wc (c1, c2, forcecoll)
s1[0] = c1;
s2[0] = c2;
#if 0 /* TAG: bash-5.1 */
#if 0 /* TAG:bash-5.1 */
/* We impose a total ordering here by returning c1-c2 if wcscoll returns 0,
as we do above in the single-byte case. */
as we do above in the single-byte case. If we do this, we can no longer
use this code in collequiv_wc */
if ((r = wcscoll (s1, s2)) != 0)
return r;
return ((int)(c1 - c2)); /* impose total ordering */
@@ -317,11 +349,26 @@ rangecmp_wc (c1, c2, forcecoll)
#endif
}
/* Returns non-zero on success */
static int
collequiv_wc (c, equiv)
wint_t c, equiv;
{
return (rangecmp_wc (c, equiv, 1) == 0);
wchar_t s, p;
if (rangecmp_wc (c, equiv, 1) == 0)
return 1;
#if FNMATCH_EQUIV_FALLBACK
/* We check explicitly for success (fnmatch returns 0) to avoid problems if
our local definition of FNM_NOMATCH (strmatch.h) doesn't match the
system's (fnmatch.h). We don't care about error return values here. */
s = c;
p = equiv;
return (_fnmatch_fallback_wc (s, p) == 0);
#else
return 0;
#endif
}
/* Helper function for collating symbol. */
+197 -402
View File
File diff suppressed because it is too large Load Diff
+729 -1496
View File
File diff suppressed because it is too large Load Diff
+608 -1220
View File
File diff suppressed because it is too large Load Diff
+237 -483
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/bash/bash-current
BUILD_DIR=/usr/local/build/chet/bash/bash-current
THIS_SH=$BUILD_DIR/bash
PATH=$PATH:$BUILD_DIR