commit bash-20130208 snapshot

This commit is contained in:
Chet Ramey
2013-03-04 08:10:00 -05:00
parent 208fdb509e
commit 10e7843372
17 changed files with 4235 additions and 1784 deletions
+31 -1
View File
@@ -233,7 +233,7 @@ uuu. Fixed a bug that caused the shell to dump core if `read' reads an escaped
vvv. Fixed a bug that caused BASH_COMMAND to be set to an incorrect value when
executing a (...) subshell.
www. Fixed a pointer aliasing bug with the token string in arithmetic
www. Fixed a couple of pointer aliasing bugs with the token string in arithmetic
evaluation.
xxx. Fixed a bug with parsing multi-line command substitutions when reading
@@ -285,6 +285,36 @@ llll. Fixed a bug that caused the -e option to be re-enabled using `set -e'
mmmm. Fixed a (mostly theoretical) bug with input lines longer than SIZE_MAX.
nnnn. Fixed a bug that could result in double evaluation of command
substitutions when they appear in failed redirections.
oooo. Fixed a bug that could cause seg faults during `mapfile' callbacks if
the callback unsets the array variable mapfile is using.
pppp. Fixed several problems with variable assignments using ${var:=value}
when the variable assignment is supposed to have side effects.
qqqq. Fixed a bug that caused a failure of an assignment statement preceding a
builtin caused the next invocation of a special builtin to exit the shell.
rrrr. Fixed several problems with IFS when it appears in the temporary environment
and is used in redirections.
ssss. Fixed a problem that caused IFS changes using ${IFS:=value} to modify
how preceding expansions were split.
tttt. Fixed a problem that caused subshells to not run an EXIT trap they set.
uuuu. Fixed a problem that caused shells started in posix mode to attempt to
import shell functions with invalid names from the environment. We now
print a warning.
vvvv. Worked around a kernel problem that caused SIGCHLD to interrupt open(2)
on a FIFO used for process substitution, even if the SIGCHLD handler was
installed with the SA_RESTART flag.
wwww. Fixed a problem that resulted in inconsistent expansion of $* and ${a[*]}.
2. Changes to Readline
a. Fixed a bug that did not allow the `dd', `cc', or `yy' vi editing mode
+20
View File
@@ -4502,3 +4502,23 @@ variables.c
but create them as (invisible) exported variables so they pass
through the environment. Print an error message so user knows
what's wrong. Fixes bug reported by Tomas Trnka <ttrnka@mail.muni.cz>
2/9
---
builtins/read.def
- sigalrm_seen, alrmbuf: now global so the rest of the shell (trap.c)
can use them
- sigalrm: just sets flag, no longer longjmps to alrmbuf; problem was
longjmp without manipulating signal mask, leaving SIGALRM blocked
quit.h
- move CHECK_ALRM macro here from builtins/read.def so trap.c:
check_signals() can call it
trap.c
- check_signals: add call to CHECK_ALRM before QUIT
- check_signals_and_traps: call check_signals() instead of including
CHECK_ALRM and QUIT inline. Integrating check for read builtin's
SIGALRM (where zread call to check_signals_and_traps can see it)
fixes problem reported by Mike Frysinger <vapier@gentoo.org>
+27
View File
@@ -4493,3 +4493,30 @@ builtins/setattr.def
bother marking the temporary variable for propagation if so. The
propagation is superfluous and will result in a strange error
message
2/2
---
variables.c
- initialize_shell_variables: don't try to import function definitions
with invalid names from the environment if already in posix mode,
but create them as (invisible) exported variables so they pass
through the environment. Print an error message so user knows
what's wrong. Fixes bug reported by Tomas Trnka <ttrnka@mail.muni.cz>
2/9
---
builtins/read.def
- sigalrm_seen, alrmbuf: now global so the rest of the shell (trap.c)
can use them
quit.h
- move CHECK_ALRM macro here from builtins/read.def so trap.c:
check_signals() can call it
trap.c
- check_signals: add call to CHECK_ALRM before QUIT
- check_signals_and_traps: call check_signals() instead of including
CHECK_ALRM and QUIT inline. Integrating check for read builtin's
SIGALRM (where zread call to check_signals_and_traps can see it)
fixes problem reported by Mike Frysinger <vapier@gentoo.org>
+3 -1
View File
@@ -1,5 +1,5 @@
@%:@! /bin/sh
@%:@ From configure.ac for Bash 4.3, version 4.054.
@%:@ From configure.ac for Bash 4.3, version 4.055.
@%:@ Guess values for system-dependent variables and create Makefiles.
@%:@ Generated by GNU Autoconf 2.68 for bash 4.3-alpha.
@%:@
@@ -2830,6 +2830,7 @@ sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF
*-mirbsd*) opt_bash_malloc=no ;; # they claim it needs eight-bit alignment
*-aix*) opt_bash_malloc=no ;; # AIX machines
*-nextstep*) opt_bash_malloc=no ;; # NeXT machines running NeXTstep
*-openstep*) opt_bash_malloc=no ;; # i386/Sparc/HP machines running Openstep
*-macos*) opt_bash_malloc=no ;; # Apple MacOS X
*-rhapsody*) opt_bash_malloc=no ;; # Apple Rhapsody (MacOS X)
*-darwin*) opt_bash_malloc=no ;; # Apple Darwin (MacOS X)
@@ -15830,6 +15831,7 @@ linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading
powerux*) LOCAL_LIBS="-lgen" ;;
cygwin*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
opennt*|interix*) LOCAL_CFLAGS="-DNO_MAIN_ENV_ARG -DBROKEN_DIRENT_D_INO -D_POSIX_SOURCE -D_ALL_SOURCE -DRECYCLES_PIDS" ;;
*openstep*) LOCAL_CFLAGS="-D__APPLE_CC__" ;;
esac
case "${host_os}-${CC}" in
+71 -71
View File
@@ -15,55 +15,55 @@
'configure.in'
],
{
'_LT_AC_TAGCONFIG' => 1,
'AM_PROG_F77_C_O' => 1,
'AC_INIT' => 1,
'_LT_AC_TAGCONFIG' => 1,
'm4_pattern_forbid' => 1,
'_AM_COND_IF' => 1,
'AC_INIT' => 1,
'AC_CANONICAL_TARGET' => 1,
'AC_SUBST' => 1,
'_AM_COND_IF' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_FC_SRCEXT' => 1,
'AC_SUBST' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_FC_SRCEXT' => 1,
'AC_PROG_LIBTOOL' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AM_PATH_GUILE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_PATH_GUILE' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'AC_CONFIG_LINKS' => 1,
'm4_sinclude' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'LT_SUPPORTED_TAG' => 1,
'm4_sinclude' => 1,
'AM_MAINTAINER_MODE' => 1,
'AM_NLS' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'_m4_warn' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'AM_PROG_CXX_C_O' => 1,
'_AM_COND_ENDIF' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'_AM_COND_ENDIF' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AM_SILENT_RULES' => 1,
'AM_PROG_MOC' => 1,
'AC_CONFIG_FILES' => 1,
'include' => 1,
'LT_INIT' => 1,
'AM_PROG_AR' => 1,
'include' => 1,
'AM_GNU_GETTEXT' => 1,
'AM_PROG_AR' => 1,
'AC_LIBSOURCE' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_CANONICAL_BUILD' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_FC_FREEFORM' => 1,
'AH_OUTPUT' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'sinclude' => 1,
'AM_PROG_CC_C_O' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'm4_pattern_allow' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_PROG_CC_C_O' => 1,
'sinclude' => 1,
'AM_CONDITIONAL' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AM_POT_TOOLS' => 1,
@@ -84,55 +84,55 @@
'configure.in'
],
{
'AM_PROG_F77_C_O' => 1,
'_LT_AC_TAGCONFIG' => 1,
'm4_pattern_forbid' => 1,
'AM_PROG_F77_C_O' => 1,
'AC_INIT' => 1,
'AC_CANONICAL_TARGET' => 1,
'm4_pattern_forbid' => 1,
'_AM_COND_IF' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_CANONICAL_TARGET' => 1,
'AC_SUBST' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_FC_SRCEXT' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_PROG_LIBTOOL' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_PATH_GUILE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AC_CONFIG_LINKS' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'LT_SUPPORTED_TAG' => 1,
'AC_CONFIG_LINKS' => 1,
'm4_sinclude' => 1,
'LT_SUPPORTED_TAG' => 1,
'AM_MAINTAINER_MODE' => 1,
'AM_NLS' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'_m4_warn' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'_m4_warn' => 1,
'AM_PROG_CXX_C_O' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'_AM_COND_ENDIF' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AM_SILENT_RULES' => 1,
'AM_PROG_MOC' => 1,
'AC_CONFIG_FILES' => 1,
'LT_INIT' => 1,
'include' => 1,
'AM_GNU_GETTEXT' => 1,
'LT_INIT' => 1,
'AM_PROG_AR' => 1,
'AM_GNU_GETTEXT' => 1,
'AC_LIBSOURCE' => 1,
'AC_CANONICAL_BUILD' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_CANONICAL_BUILD' => 1,
'AC_FC_FREEFORM' => 1,
'AH_OUTPUT' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'm4_pattern_allow' => 1,
'AM_PROG_CC_C_O' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'sinclude' => 1,
'AM_CONDITIONAL' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_PROG_CC_C_O' => 1,
'm4_pattern_allow' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_CONDITIONAL' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AM_POT_TOOLS' => 1,
@@ -155,19 +155,19 @@
{
'm4_pattern_forbid' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_C_VOLATILE' => 1,
'AC_TYPE_OFF_T' => 1,
'AC_C_VOLATILE' => 1,
'AC_FUNC_CLOSEDIR_VOID' => 1,
'AC_REPLACE_FNMATCH' => 1,
'AC_PROG_LIBTOOL' => 1,
'AC_FUNC_STAT' => 1,
'AC_FUNC_WAIT3' => 1,
'AC_HEADER_TIME' => 1,
'AC_FUNC_LSTAT' => 1,
'AC_STRUCT_TM' => 1,
'AC_FUNC_WAIT3' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AC_FUNC_GETMNTENT' => 1,
'AC_STRUCT_TM' => 1,
'AC_FUNC_LSTAT' => 1,
'AC_TYPE_MODE_T' => 1,
'AC_FUNC_GETMNTENT' => 1,
'AC_FUNC_STRTOD' => 1,
'AC_CHECK_HEADERS' => 1,
'AC_FUNC_STRNLEN' => 1,
@@ -186,17 +186,17 @@
'AC_STRUCT_ST_BLOCKS' => 1,
'AC_TYPE_SIGNAL' => 1,
'AC_TYPE_UID_T' => 1,
'AC_PROG_MAKE_SET' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'm4_pattern_allow' => 1,
'AC_PROG_MAKE_SET' => 1,
'sinclude' => 1,
'm4_pattern_allow' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AC_FUNC_STRERROR_R' => 1,
'AC_PROG_CC' => 1,
'AC_DECL_SYS_SIGLIST' => 1,
'AC_FUNC_FORK' => 1,
'AC_FUNC_STRCOLL' => 1,
'AC_DECL_SYS_SIGLIST' => 1,
'AC_FUNC_VPRINTF' => 1,
'AC_FUNC_STRCOLL' => 1,
'AC_PROG_YACC' => 1,
'AC_INIT' => 1,
'AC_STRUCT_TIMEZONE' => 1,
@@ -218,33 +218,33 @@
'AM_MAINTAINER_MODE' => 1,
'AC_FUNC_UTIME_NULL' => 1,
'AC_FUNC_SELECT_ARGTYPES' => 1,
'AC_HEADER_STAT' => 1,
'AC_FUNC_STRFTIME' => 1,
'AC_PROG_CPP' => 1,
'AC_HEADER_STAT' => 1,
'AC_C_INLINE' => 1,
'AC_PROG_LEX' => 1,
'AC_C_CONST' => 1,
'AC_PROG_CPP' => 1,
'AC_TYPE_PID_T' => 1,
'AC_C_CONST' => 1,
'AC_PROG_LEX' => 1,
'AC_CONFIG_FILES' => 1,
'include' => 1,
'AC_FUNC_SETVBUF_REVERSED' => 1,
'AC_PROG_INSTALL' => 1,
'AM_GNU_GETTEXT' => 1,
'AC_CHECK_LIB' => 1,
'AC_FUNC_OBSTACK' => 1,
'AC_CHECK_LIB' => 1,
'AC_FUNC_MALLOC' => 1,
'AC_FUNC_GETGROUPS' => 1,
'AC_FUNC_GETLOADAVG' => 1,
'AH_OUTPUT' => 1,
'AC_FUNC_FSEEKO' => 1,
'AM_PROG_CC_C_O' => 1,
'AC_FUNC_MKTIME' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_CONDITIONAL' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AC_FUNC_MKTIME' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_HEADER_SYS_WAIT' => 1,
'AC_PROG_LN_S' => 1,
'AC_FUNC_MEMCMP' => 1,
'AC_PROG_LN_S' => 1,
'm4_include' => 1,
'AC_HEADER_DIRENT' => 1,
'AC_CHECK_FUNCS' => 1
@@ -262,55 +262,55 @@
'configure.ac'
],
{
'AM_PROG_F77_C_O' => 1,
'_LT_AC_TAGCONFIG' => 1,
'm4_pattern_forbid' => 1,
'AM_PROG_F77_C_O' => 1,
'AC_INIT' => 1,
'AC_CANONICAL_TARGET' => 1,
'm4_pattern_forbid' => 1,
'_AM_COND_IF' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_CANONICAL_TARGET' => 1,
'AC_SUBST' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_FC_SRCEXT' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_PROG_LIBTOOL' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_PATH_GUILE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AC_CONFIG_LINKS' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'LT_SUPPORTED_TAG' => 1,
'AC_CONFIG_LINKS' => 1,
'm4_sinclude' => 1,
'LT_SUPPORTED_TAG' => 1,
'AM_MAINTAINER_MODE' => 1,
'AM_NLS' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'_m4_warn' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'_m4_warn' => 1,
'AM_PROG_CXX_C_O' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'_AM_COND_ENDIF' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AM_SILENT_RULES' => 1,
'AM_PROG_MOC' => 1,
'AC_CONFIG_FILES' => 1,
'LT_INIT' => 1,
'include' => 1,
'AM_GNU_GETTEXT' => 1,
'LT_INIT' => 1,
'AM_PROG_AR' => 1,
'AM_GNU_GETTEXT' => 1,
'AC_LIBSOURCE' => 1,
'AC_CANONICAL_BUILD' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_CANONICAL_BUILD' => 1,
'AC_FC_FREEFORM' => 1,
'AH_OUTPUT' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'm4_pattern_allow' => 1,
'AM_PROG_CC_C_O' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'sinclude' => 1,
'AM_CONDITIONAL' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_PROG_CC_C_O' => 1,
'm4_pattern_allow' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AM_CONDITIONAL' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AM_POT_TOOLS' => 1,
+1652 -1652
View File
File diff suppressed because it is too large Load Diff
+9 -10
View File
@@ -136,27 +136,26 @@ static void ttyrestore __P((struct ttsave *));
static sighandler sigalrm __P((int));
static void reset_alarm __P((void));
static procenv_t alrmbuf;
static int sigalrm_seen, reading;
/* Try this to see what the rest of the shell can do with the information. */
procenv_t alrmbuf;
int sigalrm_seen;
static int reading;
static SigHandler *old_alrm;
static unsigned char delim;
/* In most cases, SIGALRM just sets a flag that we check periodically. This
/* In all cases, SIGALRM just sets a flag that we check periodically. This
avoids problems with the semi-tricky stuff we do with the xfree of
input_string at the top of the unwind-protect list (see below). */
#define CHECK_ALRM \
do { \
if (sigalrm_seen) \
longjmp (alrmbuf, 1); \
} while (0)
/* Set a flag that CHECK_ALRM can check. This relies on zread calling
trap.c:check_signals_and_traps(), which knows about sigalrm_seen and
alrmbuf. */
static sighandler
sigalrm (s)
int s;
{
sigalrm_seen = 1;
if (reading) /* do the longjmp if we get SIGALRM while in read() */
longjmp (alrmbuf, 1);
}
static void
+1084
View File
File diff suppressed because it is too large Load Diff
Vendored
+3 -1
View File
@@ -1,5 +1,5 @@
#! /bin/sh
# From configure.ac for Bash 4.3, version 4.054.
# From configure.ac for Bash 4.3, version 4.055.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for bash 4.3-alpha.
#
@@ -2830,6 +2830,7 @@ sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF
*-mirbsd*) opt_bash_malloc=no ;; # they claim it needs eight-bit alignment
*-aix*) opt_bash_malloc=no ;; # AIX machines
*-nextstep*) opt_bash_malloc=no ;; # NeXT machines running NeXTstep
*-openstep*) opt_bash_malloc=no ;; # i386/Sparc/HP machines running Openstep
*-macos*) opt_bash_malloc=no ;; # Apple MacOS X
*-rhapsody*) opt_bash_malloc=no ;; # Apple Rhapsody (MacOS X)
*-darwin*) opt_bash_malloc=no ;; # Apple Darwin (MacOS X)
@@ -15830,6 +15831,7 @@ linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading
powerux*) LOCAL_LIBS="-lgen" ;;
cygwin*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
opennt*|interix*) LOCAL_CFLAGS="-DNO_MAIN_ENV_ARG -DBROKEN_DIRENT_D_INO -D_POSIX_SOURCE -D_ALL_SOURCE -DRECYCLES_PIDS" ;;
*openstep*) LOCAL_CFLAGS="-D__APPLE_CC__" ;;
esac
case "${host_os}-${CC}" in
+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 4.3, version 4.054])dnl
AC_REVISION([for Bash 4.3, version 4.055])dnl
define(bashvers, 4.3)
define(relstatus, alpha)
@@ -79,6 +79,7 @@ sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF
*-mirbsd*) opt_bash_malloc=no ;; # they claim it needs eight-bit alignment
*-aix*) opt_bash_malloc=no ;; # AIX machines
*-nextstep*) opt_bash_malloc=no ;; # NeXT machines running NeXTstep
*-openstep*) opt_bash_malloc=no ;; # i386/Sparc/HP machines running Openstep
*-macos*) opt_bash_malloc=no ;; # Apple MacOS X
*-rhapsody*) opt_bash_malloc=no ;; # Apple Rhapsody (MacOS X)
*-darwin*) opt_bash_malloc=no ;; # Apple Darwin (MacOS X)
@@ -1075,6 +1076,7 @@ linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading
powerux*) LOCAL_LIBS="-lgen" ;;
cygwin*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
opennt*|interix*) LOCAL_CFLAGS="-DNO_MAIN_ENV_ARG -DBROKEN_DIRENT_D_INO -D_POSIX_SOURCE -D_ALL_SOURCE -DRECYCLES_PIDS" ;;
*openstep*) LOCAL_CFLAGS="-D__APPLE_CC__" ;;
esac
dnl Stanza for OS/compiler pair-specific flags
+1 -1
View File
@@ -3261,7 +3261,7 @@ waitchld (wpid, block)
child = find_process (pid, 1, &job); /* want living procs only */
#if defined (COPROCESS_SUPPORT)
coproc_pidchk (pid, status);
coproc_pidchk (pid, WSTATUS(status));
#endif
/* It is not an error to have a child terminate that we did
+30 -39
View File
@@ -2196,7 +2196,6 @@ shell_getc (remove_quoted_newline)
/* Let's not let one really really long line blow up memory allocation */
if (shell_input_line && shell_input_line_size >= 32768)
{
itrace("shell_getc: freeing shell_input_line");
free (shell_input_line);
shell_input_line = 0;
shell_input_line_size = 0;
@@ -3247,11 +3246,7 @@ parse_matched_pair (qc, open, close, lenp, flags)
}
RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64);
#if 0
if MBTEST(ch == CTLESC || ch == CTLNUL)
#else
if MBTEST(ch == CTLESC)
#endif
ret[retind++] = CTLESC;
ret[retind++] = ch;
continue;
@@ -3550,10 +3545,10 @@ eof_error:
ret[retind++] = ch;
if ((tflags & LEX_INCOMMENT) && ch == '\n')
{
{
/*itrace("parse_comsub:%d: lex_incomment -> 0 ch = `%c'", line_number, ch);*/
tflags &= ~LEX_INCOMMENT;
}
tflags &= ~LEX_INCOMMENT;
}
continue;
}
@@ -3570,11 +3565,7 @@ eof_error:
}
RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64);
#if 0
if MBTEST(ch == CTLESC || ch == CTLNUL)
#else
if MBTEST(ch == CTLESC)
#endif
ret[retind++] = CTLESC;
ret[retind++] = ch;
continue;
@@ -3699,15 +3690,15 @@ eof_error:
else if MBTEST(lex_rwlen == 4 && shellbreak (ch))
{
if (STREQN (ret + retind - 4, "case", 4))
{
tflags |= LEX_INCASE;
{
tflags |= LEX_INCASE;
/*itrace("parse_comsub:%d: found `case', lex_incase -> 1 lex_reswdok -> 0", line_number);*/
}
}
else if (STREQN (ret + retind - 4, "esac", 4))
{
tflags &= ~LEX_INCASE;
{
tflags &= ~LEX_INCASE;
/*itrace("parse_comsub:%d: found `esac', lex_incase -> 0 lex_reswdok -> 0", line_number);*/
}
}
tflags &= ~LEX_RESWDOK;
}
else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0)))
@@ -3719,33 +3710,33 @@ eof_error:
(isblank(ch) || ch == '\n') &&
lex_rwlen == 2 &&
STREQN (ret + retind - 2, "do", 2))
{
{
/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', found \"do\"", line_number, ch);*/
lex_rwlen = 0;
}
lex_rwlen = 0;
}
else if MBTEST((tflags & LEX_INCASE) && ch != '\n')
/* If we can read a reserved word and we're in case, we're at the
point where we can read a new pattern list or an esac. We
handle the esac case above. If we read a newline, we want to
leave LEX_RESWDOK alone. If we read anything else, we want to
turn off LEX_RESWDOK, since we're going to read a pattern list. */
{
tflags &= ~LEX_RESWDOK;
{
tflags &= ~LEX_RESWDOK;
/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', lex_reswordok -> 0", line_number, ch);*/
}
}
else if MBTEST(shellbreak (ch) == 0)
{
tflags &= ~LEX_RESWDOK;
{
tflags &= ~LEX_RESWDOK;
/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/
}
}
#if 0
/* If we find a space or tab but have read something and it's not
`do', turn off the reserved-word-ok flag */
else if MBTEST(isblank (ch) && lex_rwlen > 0)
{
tflags &= ~LEX_RESWDOK;
{
tflags &= ~LEX_RESWDOK;
/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/
}
}
#endif
}
@@ -3784,10 +3775,10 @@ eof_error:
ch = peekc; /* fall through and continue XXX */
}
else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (((tflags & LEX_RESWDOK) && lex_rwlen == 0) || ((tflags & LEX_INWORD) && lex_wlen == 0)))
{
{
/*itrace("parse_comsub:%d: lex_incomment -> 1 (%d)", line_number, __LINE__);*/
tflags |= LEX_INCOMMENT;
}
tflags |= LEX_INCOMMENT;
}
if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */
{
@@ -3801,15 +3792,15 @@ eof_error:
tflags &= ~LEX_INCASE; /* XXX */
#endif
else if MBTEST(ch == close && (tflags & LEX_INCASE) == 0) /* ending delimiter */
{
count--;
{
count--;
/*itrace("parse_comsub:%d: found close: count = %d", line_number, count);*/
}
}
else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && (tflags & LEX_INCASE) == 0 && ch == open) /* nested begin */
{
count++;
{
count++;
/*itrace("parse_comsub:%d: found open: count = %d", line_number, count);*/
}
}
/* Add this character. */
RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64);
+6
View File
@@ -36,6 +36,12 @@ extern volatile int terminating_signal;
if (interrupt_state) throw_to_top_level (); \
} while (0)
#define CHECK_ALRM \
do { \
if (sigalrm_seen) \
longjmp (alrmbuf, 1); \
} while (0)
#define SETINTERRUPT interrupt_state = 1
#define CLRINTERRUPT interrupt_state = 0
+70
View File
@@ -0,0 +1,70 @@
/* quit.h -- How to handle SIGINT gracefully. */
/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Bash is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Bash. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined (_QUIT_H_)
#define _QUIT_H_
/* Non-zero means SIGINT has already ocurred. */
extern volatile int interrupt_state;
extern volatile int terminating_signal;
/* Macro to call a great deal. SIGINT just sets the interrupt_state variable.
When it is safe, put QUIT in the code, and the "interrupt" will take
place. The same scheme is used for terminating signals (e.g., SIGHUP)
and the terminating_signal variable. That calls a function which will
end up exiting the shell. */
#define QUIT \
do { \
if (terminating_signal) termsig_handler (terminating_signal); \
if (interrupt_state) throw_to_top_level (); \
} while (0)
#define CHECK_ALRM \
do { \
if (sigalrm_seen) \
itrace("CHECK_ALRM: sigalrm_seen = %d", sigalrm_seen); \
if (sigalrm_seen) \
longjmp (alrmbuf, 1); \
} while (0)
#define SETINTERRUPT interrupt_state = 1
#define CLRINTERRUPT interrupt_state = 0
#define ADDINTERRUPT interrupt_state++
#define DELINTERRUPT interrupt_state--
/* The same sort of thing, this time just for signals that would ordinarily
cause the shell to terminate. */
#define CHECK_TERMSIG \
do { \
if (terminating_signal) termsig_handler (terminating_signal); \
} while (0)
#define LASTSIG() \
(terminating_signal ? terminating_signal : (interrupt_state ? SIGINT : 0))
#define CHECK_WAIT_INTR \
do { \
if (wait_signal_received && this_shell_builtin && (this_shell_builtin == wait_builtin)) \
longjmp (wait_intr_buf, 1); \
} while (0)
#endif /* _QUIT_H_ */
+2
View File
@@ -395,9 +395,11 @@ binary_test (op, arg1, arg2, flags)
return (patmatch ? patcomp (arg1, arg2, EQ) : STREQ (arg1, arg2));
else if ((op[0] == '>' || op[0] == '<') && op[1] == '\0')
{
#if defined (HAVE_STRCOLL)
if (shell_compatibility_level > 40 && flags & TEST_LOCALE)
return ((op[0] == '>') ? (strcoll (arg1, arg2) > 0) : (strcoll (arg1, arg2) < 0));
else
#endif
return ((op[0] == '>') ? (strcmp (arg1, arg2) > 0) : (strcmp (arg1, arg2) < 0));
}
else if (op[0] == '!' && op[1] == '=' && op[2] == '\0')
+12 -7
View File
@@ -88,6 +88,9 @@ static void reset_or_restore_signal_handlers __P((sh_resetsig_func_t *));
extern int last_command_exit_value;
extern int line_number;
extern int sigalrm_seen;
extern procenv_t alrmbuf;
extern char *this_command_name;
extern sh_builtin_func_t *this_shell_builtin;
extern procenv_t wait_intr_buf;
@@ -456,18 +459,20 @@ any_signals_trapped ()
return -1;
}
void
check_signals ()
{
CHECK_ALRM; /* set by the read builtin */
QUIT;
}
/* Convenience functions the rest of the shell can use */
void
check_signals_and_traps ()
{
QUIT;
run_pending_traps ();
}
check_signals ();
void
check_signals ()
{
QUIT;
run_pending_traps ();
}
#if defined (JOB_CONTROL) && defined (SIGCHLD)
+1211
View File
File diff suppressed because it is too large Load Diff