From d54a780601365cfc4c46e7a2ce018fc7082745e2 Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Thu, 6 Aug 2015 16:48:35 -0400 Subject: [PATCH] commit bash-20150731 snapshot --- CWRU/CWRU.chlog | 47 ++++++++++++++++++++++++++++++++++ MANIFEST | 4 ++- builtins/exec.def | 2 ++ doc/bash.1 | 12 ++++----- doc/bashref.texi | 4 +-- doc/version.texi | 4 +-- examples/loadables/Makefile.in | 29 ++++++++++++++++++--- examples/loadables/basename.c | 1 + examples/loadables/dirname.c | 1 + examples/loadables/finfo.c | 9 ++++--- examples/loadables/head.c | 2 ++ examples/loadables/hello.c | 4 +-- examples/loadables/ln.c | 1 + examples/loadables/loadables.h | 34 ++++++++++++++++++++++++ examples/loadables/logname.c | 1 + examples/loadables/pathchk.c | 7 ++--- examples/loadables/realpath.c | 1 + examples/loadables/rmdir.c | 1 + examples/loadables/sync.c | 1 + examples/loadables/tee.c | 1 + examples/loadables/template.c | 5 ++-- examples/loadables/truefalse.c | 2 ++ examples/loadables/tty.c | 1 + examples/loadables/uname.c | 1 + examples/loadables/unlink.c | 1 + examples/loadables/whoami.c | 1 + execute_cmd.c | 2 +- jobs.c | 6 +++-- lib/malloc/malloc.c | 4 +-- lib/readline/display.c | 2 +- lib/readline/readline.h | 5 ++-- lib/readline/rlprivate.h | 7 ++--- tests/RUN-ONE-TEST | 3 ++- tests/RUN-TEST-SCRIPT | 3 +++ tests/run-alias | 4 +-- tests/run-all | 8 +++--- tests/run-appendop | 4 +-- tests/run-arith | 4 +-- tests/run-arith-for | 4 +-- tests/run-array | 4 +-- tests/run-array2 | 4 +-- tests/run-assoc | 4 +-- tests/run-braces | 4 +-- tests/run-builtins | 4 +-- tests/run-case | 4 +-- tests/run-casemod | 4 +-- tests/run-comsub | 4 +-- tests/run-comsub-eof | 4 +-- tests/run-comsub-posix | 4 +-- tests/run-cond | 4 +-- tests/run-coproc | 4 +-- tests/run-cprint | 4 +-- tests/run-dbg-support | 0 tests/run-dbg-support2 | 0 tests/run-dirstack | 8 +++--- tests/run-dollars | 4 +-- tests/run-errors | 4 +-- tests/run-execscript | 4 +-- tests/run-exp-tests | 4 +-- tests/run-exportfunc | 4 +-- tests/run-extglob | 4 +-- tests/run-extglob2 | 4 +-- tests/run-extglob3 | 4 +-- tests/run-func | 4 +-- tests/run-getopts | 4 +-- tests/run-glob-test | 4 +-- tests/run-globstar | 4 +-- tests/run-gprof | 9 ++++++- tests/run-heredoc | 4 +-- tests/run-herestr | 4 +-- tests/run-histexpand | 4 +-- tests/run-history | 4 +-- tests/run-ifs | 4 +-- tests/run-ifs-posix | 4 +-- tests/run-input-test | 4 +-- tests/run-intl | 4 +-- tests/run-invert | 4 +-- tests/run-iquote | 4 +-- tests/run-jobs | 4 +-- tests/run-lastpipe | 4 +-- tests/run-mapfile | 4 +-- tests/run-minimal | 11 +++++++- tests/run-more-exp | 4 +-- tests/run-nameref | 4 +-- tests/run-new-exp | 4 +-- tests/run-nquote | 4 +-- tests/run-nquote1 | 4 +-- tests/run-nquote2 | 4 +-- tests/run-nquote3 | 4 +-- tests/run-nquote4 | 4 +-- tests/run-nquote5 | 4 +-- tests/run-parser | 4 +-- tests/run-posix2 | 4 +-- tests/run-posixexp | 4 +-- tests/run-posixexp2 | 4 +-- tests/run-posixpat | 4 +-- tests/run-posixpipe | 4 +-- tests/run-precedence | 4 +-- tests/run-printf | 6 ++--- tests/run-quote | 4 +-- tests/run-read | 4 +-- tests/run-redir | 4 +-- tests/run-rhs-exp | 4 +-- tests/run-rsh | 4 +-- tests/run-set-e | 4 +-- tests/run-set-x | 0 tests/run-shopt | 4 +-- tests/run-strip | 4 +-- tests/run-test | 4 +-- tests/run-tilde | 4 +-- tests/run-tilde2 | 4 +-- tests/run-trap | 4 +-- tests/run-type | 4 +-- tests/run-varenv | 4 +-- tests/run-vredir | 4 +-- trap.c | 7 +++++ trap.h | 1 + 117 files changed, 354 insertions(+), 197 deletions(-) create mode 100644 examples/loadables/loadables.h mode change 100755 => 100644 tests/run-dbg-support mode change 100755 => 100644 tests/run-dbg-support2 mode change 100755 => 100644 tests/run-set-x diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 838a324c..31de3b17 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -9165,3 +9165,50 @@ input.c doc/{bash.1,bashref.texi} - note that the `return' builtin accepts arguments beginning with `-' without requiring `--' + + 7/27 + ---- +examples/loadables/Makefile.in + - add variables and targets to support `make install'; installs supported + builtins in $(libdir)/bash + + 7/28 + ---- +lib/readline/{readline,rlprivate}.h, lib/readline/display.c + - rearrange some structure members for better alignment and to reduce + padding. Fix from + +tests/run-* + - use BASH_TSTOUT instead of hardcoded /tmp/xx as output file + +trap.[ch] + - maybe_set_error_trap: set a trap for the ERR trap if it is not already + trapped; similar to maybe_set_debug_trap back from 4/10 + +lib/malloc/malloc.c + - internal_free: make sure `ubytes' is initialized if MALLOC_WATCH is defined + and we'll be passing it to _malloc_ckwatch. Report from Flavio Medeiros + + +execute_cmd.c + - execute_function: use maybe_set_error_trap in the same way as + maybe_set_debug_trap. Fixes bug reported by David Waddell + + + 7/29 + ---- +jobs.c + - wait_for: no longer need to call job_signal_status when checking whether + a comsub shell reaped a child that died due to SIGINT; code now uses + child_caught_sigint + + 7/30 + ---- +builtins/exec.def + - exec_builtin: after call to restore_original_signals, need to call + default_tty_job_signals to undo changes done by initialize_job_signals. + Fix for problem reported by Andreas Schwab + +doc/{bash.1,bashref.texi} + - clarify definition of metacharacter to explicitly include newline; + prompted by report from George Gallo diff --git a/MANIFEST b/MANIFEST index b839974a..b7e0309c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -656,6 +656,7 @@ examples/complete/complete-examples f examples/complete/bashcc-1.0.1.tar.gz f examples/loadables/README f examples/loadables/template.c f +examples/loadables/loadables.h f examples/loadables/Makefile.in f examples/loadables/necho.c f examples/loadables/hello.c f @@ -669,7 +670,8 @@ examples/loadables/truefalse.c f examples/loadables/finfo.c f examples/loadables/cat.c f #examples/loadables/cut.c f -examples/loadables/logname.c f +examples/loadables/l +ogname.c f examples/loadables/basename.c f examples/loadables/dirname.c f examples/loadables/tty.c f diff --git a/builtins/exec.def b/builtins/exec.def index 40dbd3ac..d9715115 100644 --- a/builtins/exec.def +++ b/builtins/exec.def @@ -210,6 +210,8 @@ exec_builtin (list) #if defined (JOB_CONTROL) if (subshell_environment == 0) end_job_control (); + if (interactive || job_control) + default_tty_job_signals (); /* undo initialize_job_signals */ #endif /* JOB_CONTROL */ exit_value = shell_execve (command, args, env); diff --git a/doc/bash.1 b/doc/bash.1 index e577f5d7..d36861b1 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -5,12 +5,12 @@ .\" Case Western Reserve University .\" chet.ramey@case.edu .\" -.\" Last Change: Fri Jul 24 11:33:12 EDT 2015 +.\" Last Change: Fri Jul 31 11:16:37 EDT 2015 .\" .\" bash_builtins, strip all but Built-Ins section .if \n(zZ=1 .ig zZ .if \n(zY=1 .ig zY -.TH BASH 1 "2015 July 24" "GNU Bash 4.4" +.TH BASH 1 "2015 July 31" "GNU Bash 4.4" .\" .\" There's some problem with having a `@' .\" in a tagged paragraph with the BSD man macros. @@ -477,8 +477,8 @@ A character that, when unquoted, separates words. One of the following: .br .RS .PP -.if t \fB| & ; ( ) < > space tab\fP -.if n \fB| & ; ( ) < > space tab\fP +.if t \fB| & ; ( ) < > space tab newline\fP +.if n \fB| & ; ( ) < > space tab newline\fP .RE .PP .TP @@ -7589,8 +7589,8 @@ The option inhibits the display of function definitions; only the function name and attributes are printed. If the \fBextdebug\fP shell option is enabled using \fBshopt\fP, -the source file name and line number where the function is defined -are displayed as well. The +the source file name and line number where each \fIname\fP +is defined are displayed as well. The .B \-F option implies .BR \-f . diff --git a/doc/bashref.texi b/doc/bashref.texi index f2de9951..a3240879 100644 --- a/doc/bashref.texi +++ b/doc/bashref.texi @@ -243,7 +243,7 @@ A mechanism by which users can selectively stop (suspend) and restart @item metacharacter @cindex metacharacter A character that, when unquoted, separates words. A metacharacter is -a @code{blank} or one of the following characters: +a @code{space}, @code{tab}, @code{newline}, or one of the following characters: @samp{|}, @samp{&}, @samp{;}, @samp{(}, @samp{)}, @samp{<}, or @samp{>}. @@ -3998,7 +3998,7 @@ The @option{-F} option inhibits the display of function definitions; only the function name and attributes are printed. If the @code{extdebug} shell option is enabled using @code{shopt} (@pxref{The Shopt Builtin}), the source file name and line number where -the function is defined are displayed as well. +each @var{name} is defined are displayed as well. @option{-F} implies @option{-f}. The @option{-g} option forces variables to be created or modified at diff --git a/doc/version.texi b/doc/version.texi index 7049fa89..ed54f5dc 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -2,10 +2,10 @@ Copyright (C) 1988-2015 Free Software Foundation, Inc. @end ignore -@set LASTCHANGE Fri Jul 24 11:32:31 EDT 2015 +@set LASTCHANGE Fri Jul 31 11:16:22 EDT 2015 @set EDITION 4.4 @set VERSION 4.4 -@set UPDATED 24 July 2015 +@set UPDATED 31 July 2015 @set UPDATED-MONTH July 2015 diff --git a/examples/loadables/Makefile.in b/examples/loadables/Makefile.in index 00c5270b..f3aba445 100644 --- a/examples/loadables/Makefile.in +++ b/examples/loadables/Makefile.in @@ -27,12 +27,22 @@ infodir = @infodir@ includedir = @includedir@ datarootdir = @datarootdir@ +loadablesdir = ${libdir}/bash topdir = @top_srcdir@ BUILD_DIR = @BUILD_DIR@ srcdir = @srcdir@ VPATH = @srcdir@ +# Support an alternate destination root directory for package building +DESTDIR = + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALLMODE= -m 0755 + @SET_MAKE@ CC = @CC@ RM = rm -f @@ -52,6 +62,8 @@ CPPFLAGS = @CPPFLAGS@ BASHINCDIR = ${topdir}/include +SUPPORT_SRC = $(topdir)/support/ + LIBBUILD = ${BUILD_DIR}/lib INTL_LIBSRC = ${topdir}/lib/intl @@ -75,7 +87,7 @@ SHOBJ_XLDFLAGS = @SHOBJ_XLDFLAGS@ SHOBJ_LIBS = @SHOBJ_LIBS@ SHOBJ_STATUS = @SHOBJ_STATUS@ -INC = -I. -I.. -I$(topdir) -I$(topdir)/lib -I$(topdir)/builtins \ +INC = -I. -I.. -I$(topdir) -I$(topdir)/lib -I$(topdir)/builtins -I${srcdir} \ -I$(BASHINCDIR) -I$(BUILD_DIR) -I$(LIBBUILD) \ -I$(BUILD_DIR)/builtins $(INTL_INC) @@ -83,10 +95,10 @@ INC = -I. -I.. -I$(topdir) -I$(topdir)/lib -I$(topdir)/builtins \ $(SHOBJ_CC) $(SHOBJ_CFLAGS) $(CCFLAGS) $(INC) -c -o $@ $< -ALLPROG = print truefalse sleep pushd finfo logname basename dirname \ +ALLPROG = print truefalse sleep finfo logname basename dirname \ tty pathchk tee head mkdir rmdir printenv id whoami \ uname sync push ln unlink realpath strftime mypid -OTHERPROG = necho hello cat +OTHERPROG = necho hello cat pushd all: $(SHOBJ_STATUS) @@ -210,6 +222,17 @@ distclean maintainer-clean: clean $(RM) Makefile pushd.c -( cd perl && ${MAKE} ${MFLAGS} $@ ) +installdirs: + @${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(loadablesdir) + +install: all installdirs + @echo installing example loadable builtins in $(DESTDIR)${loadablesdir} + @for prog in ${ALLPROG}; do \ + echo $$prog ; \ + $(INSTALL_PROGRAM) $(INSTALLMODE) $$prog $(DESTDIR)$(loadablesdir)/$$prog ;\ + done + + print.o: print.c truefalse.o: truefalse.c sleep.o: sleep.c diff --git a/examples/loadables/basename.c b/examples/loadables/basename.c index 7ee817f6..3ca18441 100644 --- a/examples/loadables/basename.c +++ b/examples/loadables/basename.c @@ -31,6 +31,7 @@ #include "shell.h" #include "common.h" +int basename_builtin (list) WORD_LIST *list; { diff --git a/examples/loadables/dirname.c b/examples/loadables/dirname.c index 0f30286d..69019cbc 100644 --- a/examples/loadables/dirname.c +++ b/examples/loadables/dirname.c @@ -31,6 +31,7 @@ #include "shell.h" #include "common.h" +int dirname_builtin (list) WORD_LIST *list; { diff --git a/examples/loadables/finfo.c b/examples/loadables/finfo.c index 5707f8ba..00833f68 100644 --- a/examples/loadables/finfo.c +++ b/examples/loadables/finfo.c @@ -39,6 +39,7 @@ #include "shell.h" #include "builtins.h" #include "common.h" +#include "getopt.h" #ifndef errno extern int errno; @@ -46,8 +47,10 @@ extern int errno; extern char **make_builtin_argv (); +static void perms(); static int printst(); static int printsome(); +static void printmode(); static int printfinfo(); static int finfo_main(); @@ -192,7 +195,7 @@ int m; return (m & (S_IRWXU|S_IRWXG|S_IRWXO|S_ISUID|S_ISGID)); } -static int +static void perms(m) int m; { @@ -236,7 +239,7 @@ int m; printf ("u=%s,g=%s,o=%s", ubits, gbits, obits); } -static int +static void printmode(mode) int mode; { @@ -262,7 +265,7 @@ int mode; printf("\n"); } -static int +static int printst(st) struct stat *st; { diff --git a/examples/loadables/head.c b/examples/loadables/head.c index 22cf6ab5..748bb83e 100644 --- a/examples/loadables/head.c +++ b/examples/loadables/head.c @@ -88,8 +88,10 @@ file_head (fp, cnt) break; } } + return (EXECUTION_SUCCESS); } +int head_builtin (list) WORD_LIST *list; { diff --git a/examples/loadables/hello.c b/examples/loadables/hello.c index 643156c4..9a23b5bb 100644 --- a/examples/loadables/hello.c +++ b/examples/loadables/hello.c @@ -29,9 +29,7 @@ #include -#include "builtins.h" -#include "shell.h" -#include "bashgetopt.h" +#include "loadables.h" /* A builtin `xxx' is normally implemented with an `xxx_builtin' function. If you're converting a command that uses the normal Unix argc/argv diff --git a/examples/loadables/ln.c b/examples/loadables/ln.c index ec736368..3a675acb 100644 --- a/examples/loadables/ln.c +++ b/examples/loadables/ln.c @@ -50,6 +50,7 @@ typedef int unix_link_syscall_t __P((const char *, const char *)); static unix_link_syscall_t *linkfn; static int dolink (); +int ln_builtin (list) WORD_LIST *list; { diff --git a/examples/loadables/loadables.h b/examples/loadables/loadables.h new file mode 100644 index 00000000..c7303572 --- /dev/null +++ b/examples/loadables/loadables.h @@ -0,0 +1,34 @@ +/* loadables.h -- Include files needed by all loadable builtins */ + +/* Copyright (C) 2015 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 . +*/ + + +#ifndef __LOADABLES_H_ +#define __LOADABLES_H_ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "builtins.h" +#include "shell.h" +#include "bashgetopt.h" +#include "common.h" + +#endif diff --git a/examples/loadables/logname.c b/examples/loadables/logname.c index 95b7e218..27e6591b 100644 --- a/examples/loadables/logname.c +++ b/examples/loadables/logname.c @@ -35,6 +35,7 @@ extern int errno; #endif +int logname_builtin (list) WORD_LIST *list; { diff --git a/examples/loadables/pathchk.c b/examples/loadables/pathchk.c index c5fd24a8..85e8a04c 100644 --- a/examples/loadables/pathchk.c +++ b/examples/loadables/pathchk.c @@ -98,6 +98,7 @@ extern char *strerror (); static int validate_path (); +int pathchk_builtin (list) WORD_LIST *list; { @@ -323,7 +324,7 @@ validate_path (path, portability) if (!last_elem) { exists = dir_ok (path); - if (dir_ok == 0) + if (exists == 0) { free (parent); return 1; @@ -370,8 +371,8 @@ validate_path (path, portability) free (parent); if (strlen (path) > path_max) { - builtin_error ("path `%s' has length %d; exceeds limit of %d", - path, strlen (path), path_max); + builtin_error ("path `%s' has length %lu; exceeds limit of %d", + path, (unsigned long)strlen (path), path_max); return 1; } diff --git a/examples/loadables/realpath.c b/examples/loadables/realpath.c index ffcbef8b..b19b87fb 100644 --- a/examples/loadables/realpath.c +++ b/examples/loadables/realpath.c @@ -60,6 +60,7 @@ extern int errno; extern char *sh_realpath(); +int realpath_builtin(list) WORD_LIST *list; { diff --git a/examples/loadables/rmdir.c b/examples/loadables/rmdir.c index 0cfe6c79..001c2bd9 100644 --- a/examples/loadables/rmdir.c +++ b/examples/loadables/rmdir.c @@ -32,6 +32,7 @@ extern int errno; #endif +int rmdir_builtin (list) WORD_LIST *list; { diff --git a/examples/loadables/sync.c b/examples/loadables/sync.c index d91852e7..4fbeee1c 100644 --- a/examples/loadables/sync.c +++ b/examples/loadables/sync.c @@ -28,6 +28,7 @@ #include "shell.h" #include "bashgetopt.h" +int sync_builtin (list) WORD_LIST *list; { diff --git a/examples/loadables/tee.c b/examples/loadables/tee.c index 8b5715f2..9462cda0 100644 --- a/examples/loadables/tee.c +++ b/examples/loadables/tee.c @@ -60,6 +60,7 @@ extern int interrupt_immediately; extern char *strerror (); +int tee_builtin (list) WORD_LIST *list; { diff --git a/examples/loadables/template.c b/examples/loadables/template.c index 3a5814f3..64dd79ad 100644 --- a/examples/loadables/template.c +++ b/examples/loadables/template.c @@ -11,9 +11,7 @@ #include #include -#include "builtins.h" -#include "shell.h" -#include "bashgetopt.h" +#include "loadables.h" #if !defined (errno) extern int errno; @@ -21,6 +19,7 @@ extern int errno; extern char *strerror (); +int template_builtin (list) WORD_LIST *list; { diff --git a/examples/loadables/truefalse.c b/examples/loadables/truefalse.c index 113e88f7..e011fa1f 100644 --- a/examples/loadables/truefalse.c +++ b/examples/loadables/truefalse.c @@ -25,12 +25,14 @@ #include "builtins.h" #include "common.h" +int true_builtin (list) WORD_LIST *list; { return EXECUTION_SUCCESS; } +int false_builtin (list) WORD_LIST *list; { diff --git a/examples/loadables/tty.c b/examples/loadables/tty.c index 1d88506c..1adc5b59 100644 --- a/examples/loadables/tty.c +++ b/examples/loadables/tty.c @@ -30,6 +30,7 @@ extern char *ttyname (); +int tty_builtin (list) WORD_LIST *list; { diff --git a/examples/loadables/uname.c b/examples/loadables/uname.c index a1bddd54..339ec3dd 100644 --- a/examples/loadables/uname.c +++ b/examples/loadables/uname.c @@ -63,6 +63,7 @@ static void uprint(); static int uname_flags; +int uname_builtin (list) WORD_LIST *list; { diff --git a/examples/loadables/unlink.c b/examples/loadables/unlink.c index 07e3f3d4..ff2a78a0 100644 --- a/examples/loadables/unlink.c +++ b/examples/loadables/unlink.c @@ -38,6 +38,7 @@ extern int errno; #endif +int unlink_builtin (list) WORD_LIST *list; { diff --git a/examples/loadables/whoami.c b/examples/loadables/whoami.c index 6f8471ac..5aa73828 100644 --- a/examples/loadables/whoami.c +++ b/examples/loadables/whoami.c @@ -28,6 +28,7 @@ #include "bashgetopt.h" #include "common.h" +int whoami_builtin (list) WORD_LIST *list; { diff --git a/execute_cmd.c b/execute_cmd.c index 567a3a74..6c58b2c2 100644 --- a/execute_cmd.c +++ b/execute_cmd.c @@ -4601,7 +4601,7 @@ execute_function (var, words, flags, fds_to_close, async, subshell) { error_trap = savestring (error_trap); add_unwind_protect (xfree, error_trap); - add_unwind_protect (set_error_trap, error_trap); + add_unwind_protect (maybe_set_error_trap, error_trap); } restore_default_signal (ERROR_TRAP); } diff --git a/jobs.c b/jobs.c index ab0cc11a..22703ed4 100644 --- a/jobs.c +++ b/jobs.c @@ -169,6 +169,8 @@ extern int wait_intr_flag; extern int wait_signal_received; extern WORD_LIST *subst_assign_varlist; +extern SigHandler **original_signals; + static struct jobstats zerojs = { -1L, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NO_JOB, NO_JOB, 0, 0 }; struct jobstats js = { -1L, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NO_JOB, NO_JOB, 0, 0 }; @@ -2745,7 +2747,7 @@ if (job == NO_JOB) something like a while loop or a for loop, simulate getting and being killed by the SIGINT to pass the status back to our parent. */ - s = job_signal_status (job); +/* s = job_signal_status (job); /* XXX - no longer needed */ if (child_caught_sigint == 0 && signal_is_trapped (SIGINT) == 0) { @@ -3645,7 +3647,7 @@ set_job_status_and_cleanup (job) In this case, we have to fix things up. What a crock. */ if (temp_handler == trap_handler && signal_is_trapped (SIGINT) == 0) temp_handler = trap_to_sighandler (SIGINT); - restore_sigint_handler (); + restore_sigint_handler (); if (temp_handler == SIG_DFL) termsig_handler (SIGINT); /* XXX */ else if (temp_handler != SIG_IGN) diff --git a/lib/malloc/malloc.c b/lib/malloc/malloc.c index cd987c0d..053305fc 100644 --- a/lib/malloc/malloc.c +++ b/lib/malloc/malloc.c @@ -866,8 +866,8 @@ internal_free (mem, file, line, flags) p = (union mhead *) ap - 1; } -#if defined (MALLOC_TRACE) || defined (MALLOC_REGISTER) - if (malloc_trace || malloc_register) +#if defined (MALLOC_TRACE) || defined (MALLOC_REGISTER) || defined (MALLOC_WATCH) + if (malloc_trace || malloc_register || _malloc_nwatch > 0) ubytes = p->mh_nbytes; #endif diff --git a/lib/readline/display.c b/lib/readline/display.c index c6b14fb5..4353d6e0 100644 --- a/lib/readline/display.c +++ b/lib/readline/display.c @@ -83,8 +83,8 @@ struct line_state int *lbreaks; int lbsize; #if defined (HANDLE_MULTIBYTE) - int *wrapped_line; int wbsize; + int *wrapped_line; #endif }; diff --git a/lib/readline/readline.h b/lib/readline/readline.h index fa458bee..8d71f9a7 100644 --- a/lib/readline/readline.h +++ b/lib/readline/readline.h @@ -884,8 +884,8 @@ struct readline_state { int point; int end; int mark; - char *buffer; int buflen; + char *buffer; UNDO_LIST *ul; char *prompt; @@ -900,9 +900,10 @@ struct readline_state { int edmode; char *kseq; int kseqlen; + + int pendingin; FILE *inf; FILE *outf; - int pendingin; char *macro; /* signal state */ diff --git a/lib/readline/rlprivate.h b/lib/readline/rlprivate.h index 55b7e6b9..8064f9ff 100644 --- a/lib/readline/rlprivate.h +++ b/lib/readline/rlprivate.h @@ -125,10 +125,11 @@ typedef struct __rl_keyseq_context int flags; int subseq_arg; int subseq_retval; /* XXX */ - Keymap dmap; - - Keymap oldmap; int okey; + + Keymap dmap; + Keymap oldmap; + struct __rl_keyseq_context *ocxt; int childval; } _rl_keyseq_cxt; diff --git a/tests/RUN-ONE-TEST b/tests/RUN-ONE-TEST index 3efcf32d..d29259a9 100755 --- a/tests/RUN-ONE-TEST +++ b/tests/RUN-ONE-TEST @@ -4,6 +4,7 @@ PATH=$PATH:$BUILD_DIR export THIS_SH PATH -rm -f /tmp/xx +export BASH_TSTOUT=/tmp/xx +rm -f ${BASH_TSTOUT} /bin/sh "$@" diff --git a/tests/RUN-TEST-SCRIPT b/tests/RUN-TEST-SCRIPT index 75fe5947..3740723b 100755 --- a/tests/RUN-TEST-SCRIPT +++ b/tests/RUN-TEST-SCRIPT @@ -4,4 +4,7 @@ PATH=$PATH:$BUILD_DIR export THIS_SH PATH +export BASH_TSTOUT=/tmp/xx +rm -f ${BASH_TSTOUT} + ${THIS_SH} "$@" diff --git a/tests/run-alias b/tests/run-alias index 6a20b06e..3b4f4dcf 100644 --- a/tests/run-alias +++ b/tests/run-alias @@ -1,2 +1,2 @@ -${THIS_SH} ./alias.tests > /tmp/xx 2>&1 -diff /tmp/xx alias.right && rm -f /tmp/xx +${THIS_SH} ./alias.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} alias.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-all b/tests/run-all index f1a43972..2b004b5c 100644 --- a/tests/run-all +++ b/tests/run-all @@ -3,10 +3,10 @@ : ${TMPDIR:=/tmp} export TMPDIR -BASH_TMPOUT=/tmp/xx # for now -export BASH_TMPOUT +BASH_TSTOUT=/tmp/xx # for now +export BASH_TSTOUT -trap 'rm -f $BASH_TMPOUT' 0 +trap 'rm -f $BASH_TSTOUT' 0 PATH=.:$PATH # just to get recho/zecho/printenv if not run via `make tests' export PATH @@ -21,7 +21,7 @@ export THIS_SH ${THIS_SH} ./version -rm -f ${BASH_TMPOUT} +rm -f ${BASH_TSTOUT} echo Any output from any test, unless otherwise noted, indicates a possible anomaly diff --git a/tests/run-appendop b/tests/run-appendop index c5bffbc1..2d756f8b 100644 --- a/tests/run-appendop +++ b/tests/run-appendop @@ -1,2 +1,2 @@ -${THIS_SH} ./appendop.tests > /tmp/xx 2>&1 -diff /tmp/xx appendop.right && rm -f /tmp/xx +${THIS_SH} ./appendop.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} appendop.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-arith b/tests/run-arith index f9f573c6..0786b4fa 100644 --- a/tests/run-arith +++ b/tests/run-arith @@ -1,2 +1,2 @@ -${THIS_SH} ./arith.tests > /tmp/xx 2>&1 -diff /tmp/xx arith.right && rm -f /tmp/xx +${THIS_SH} ./arith.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} arith.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-arith-for b/tests/run-arith-for index 1d130752..085715e2 100644 --- a/tests/run-arith-for +++ b/tests/run-arith-for @@ -1,2 +1,2 @@ -${THIS_SH} ./arith-for.tests > /tmp/xx 2>&1 -diff /tmp/xx arith-for.right && rm -f /tmp/xx +${THIS_SH} ./arith-for.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} arith-for.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-array b/tests/run-array index 6fdbae49..6c5ec277 100644 --- a/tests/run-array +++ b/tests/run-array @@ -2,5 +2,5 @@ echo "warning: all of these tests will fail if arrays have not" >&2 echo "warning: been compiled into the shell" >&2 echo "warning: the BASH_ARGC and BASH_ARGV tests will fail if debugging support" >&2 echo "warning: has not been compiled into the shell" >&2 -${THIS_SH} ./array.tests > /tmp/xx 2>&1 -diff /tmp/xx array.right && rm -f /tmp/xx +${THIS_SH} ./array.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} array.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-array2 b/tests/run-array2 index dd94ec82..54852ec9 100644 --- a/tests/run-array2 +++ b/tests/run-array2 @@ -1,4 +1,4 @@ echo "warning: all of these tests will fail if arrays have not" >&2 echo "warning: been compiled into the shell" >&2 -${THIS_SH} ./array-at-star > /tmp/xx 2>&1 -diff /tmp/xx array2.right && rm -f /tmp/xx +${THIS_SH} ./array-at-star > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} array2.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-assoc b/tests/run-assoc index 18c3a9cf..7fef2344 100644 --- a/tests/run-assoc +++ b/tests/run-assoc @@ -1,4 +1,4 @@ echo "warning: all of these tests will fail if arrays have not" >&2 echo "warning: been compiled into the shell" >&2 -${THIS_SH} ./assoc.tests > /tmp/xx 2>&1 -diff /tmp/xx assoc.right && rm -f /tmp/xx +${THIS_SH} ./assoc.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} assoc.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-braces b/tests/run-braces index 53d4f1b7..554e2183 100644 --- a/tests/run-braces +++ b/tests/run-braces @@ -1,2 +1,2 @@ -${THIS_SH} ./braces.tests > /tmp/xx -diff /tmp/xx braces.right && rm -f /tmp/xx +${THIS_SH} ./braces.tests > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} braces.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-builtins b/tests/run-builtins index db88c8c1..69644f27 100644 --- a/tests/run-builtins +++ b/tests/run-builtins @@ -2,5 +2,5 @@ echo "warning: some of these tests may fail if process substitution has not" >&2 echo "warning: been compiled into the shell or if the OS does not provide" >&2 echo "warning: /dev/fd." >&2 -${THIS_SH} ./builtins.tests > /tmp/xx 2>&1 -diff /tmp/xx builtins.right && rm -f /tmp/xx +${THIS_SH} ./builtins.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} builtins.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-case b/tests/run-case index 71d9b83d..1560ee2f 100644 --- a/tests/run-case +++ b/tests/run-case @@ -1,2 +1,2 @@ -${THIS_SH} ./case.tests > /tmp/xx 2>&1 -diff /tmp/xx case.right && rm -f /tmp/xx +${THIS_SH} ./case.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} case.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-casemod b/tests/run-casemod index 83c1b5a3..9b58764c 100644 --- a/tests/run-casemod +++ b/tests/run-casemod @@ -1,2 +1,2 @@ -${THIS_SH} ./casemod.tests > /tmp/xx 2>&1 -diff /tmp/xx casemod.right && rm -f /tmp/xx +${THIS_SH} ./casemod.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} casemod.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-comsub b/tests/run-comsub index 0bbcad5e..4c3d1cfb 100644 --- a/tests/run-comsub +++ b/tests/run-comsub @@ -1,2 +1,2 @@ -${THIS_SH} ./comsub.tests > /tmp/xx 2>&1 -diff /tmp/xx comsub.right && rm -f /tmp/xx +${THIS_SH} ./comsub.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} comsub.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-comsub-eof b/tests/run-comsub-eof index 5c006be1..0733b2de 100644 --- a/tests/run-comsub-eof +++ b/tests/run-comsub-eof @@ -1,2 +1,2 @@ -${THIS_SH} ./comsub-eof.tests > /tmp/xx 2>&1 -diff /tmp/xx comsub-eof.right && rm -f /tmp/xx +${THIS_SH} ./comsub-eof.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} comsub-eof.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-comsub-posix b/tests/run-comsub-posix index 38bf8eea..520cb442 100644 --- a/tests/run-comsub-posix +++ b/tests/run-comsub-posix @@ -1,2 +1,2 @@ -${THIS_SH} ./comsub-posix.tests > /tmp/xx 2>&1 -diff /tmp/xx comsub-posix.right && rm -f /tmp/xx +${THIS_SH} ./comsub-posix.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} comsub-posix.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-cond b/tests/run-cond index 6b119a62..603e7397 100644 --- a/tests/run-cond +++ b/tests/run-cond @@ -3,5 +3,5 @@ echo "warning: been compiled into the shell" >&2 echo "warning: some of these tests will fail if extended pattern matching has not" >&2 echo "warning: been compiled into the shell" >&2 -${THIS_SH} ./cond.tests > /tmp/xx 2>&1 -diff /tmp/xx cond.right && rm -f /tmp/xx +${THIS_SH} ./cond.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} cond.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-coproc b/tests/run-coproc index 6aa9915f..02c5c922 100644 --- a/tests/run-coproc +++ b/tests/run-coproc @@ -1,2 +1,2 @@ -${THIS_SH} ./coproc.tests > /tmp/xx 2>&1 -diff /tmp/xx coproc.right && rm -f /tmp/xx +${THIS_SH} ./coproc.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} coproc.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-cprint b/tests/run-cprint index 5f202e43..82d2c2a2 100644 --- a/tests/run-cprint +++ b/tests/run-cprint @@ -1,2 +1,2 @@ -${THIS_SH} ./cprint.tests > /tmp/xx 2>&1 -diff /tmp/xx cprint.right && rm -f /tmp/xx +${THIS_SH} ./cprint.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} cprint.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-dbg-support b/tests/run-dbg-support old mode 100755 new mode 100644 diff --git a/tests/run-dbg-support2 b/tests/run-dbg-support2 old mode 100755 new mode 100644 diff --git a/tests/run-dirstack b/tests/run-dirstack index 6390d1b7..e6b42d43 100644 --- a/tests/run-dirstack +++ b/tests/run-dirstack @@ -1,5 +1,5 @@ -${THIS_SH} ./dstack.tests > /tmp/xx 2>&1 -diff /tmp/xx dstack.right && rm -f /tmp/xx +${THIS_SH} ./dstack.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} dstack.right && rm -f ${BASH_TSTOUT} -${THIS_SH} ./dstack2.tests > /tmp/xx 2>&1 -diff /tmp/xx dstack2.right && rm -f /tmp/xx +${THIS_SH} ./dstack2.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} dstack2.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-dollars b/tests/run-dollars index 0ced4145..dc5d6238 100644 --- a/tests/run-dollars +++ b/tests/run-dollars @@ -1,2 +1,2 @@ -${THIS_SH} ./dollar-at-star > /tmp/xx 2>&1 -diff /tmp/xx dollar.right && rm -f /tmp/xx +${THIS_SH} ./dollar-at-star > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} dollar.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-errors b/tests/run-errors index 6be4e0c7..d9179c69 100644 --- a/tests/run-errors +++ b/tests/run-errors @@ -1,2 +1,2 @@ -${THIS_SH} ./errors.tests > /tmp/xx 2>&1 -diff /tmp/xx errors.right && rm -f /tmp/xx +${THIS_SH} ./errors.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} errors.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-execscript b/tests/run-execscript index f97ab21b..de786442 100644 --- a/tests/run-execscript +++ b/tests/run-execscript @@ -5,5 +5,5 @@ echo "warning: \`/tmp/bash-notthere' not being found or \`/' being a directory" echo "warning: produce diff output, please do not consider this a test failure" >&2 echo "warning: if diff output differing only in the location of the bash" >&2 echo "warning: binary appears, please do not consider this a test failure" >&2 -${THIS_SH} ./execscript > /tmp/xx 2>&1 -diff /tmp/xx exec.right && rm -f /tmp/xx +${THIS_SH} ./execscript > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} exec.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-exp-tests b/tests/run-exp-tests index d45ba6a7..78cf754d 100644 --- a/tests/run-exp-tests +++ b/tests/run-exp-tests @@ -1,2 +1,2 @@ -${THIS_SH} ./exp.tests 2>&1 | grep -v '^expect' > /tmp/xx -diff /tmp/xx exp.right && rm -f /tmp/xx +${THIS_SH} ./exp.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} exp.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-exportfunc b/tests/run-exportfunc index ef8fbe80..7b207fa9 100644 --- a/tests/run-exportfunc +++ b/tests/run-exportfunc @@ -1,2 +1,2 @@ -${THIS_SH} ./exportfunc.tests > /tmp/xx 2>&1 -diff /tmp/xx exportfunc.right && rm -f /tmp/xx +${THIS_SH} ./exportfunc.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} exportfunc.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-extglob b/tests/run-extglob index 06316ad3..149e34af 100644 --- a/tests/run-extglob +++ b/tests/run-extglob @@ -1,4 +1,4 @@ PATH=$PATH:`pwd` export PATH -${THIS_SH} ./extglob.tests | grep -v '^expect' > /tmp/xx -diff /tmp/xx extglob.right && rm -f /tmp/xx +${THIS_SH} ./extglob.tests | grep -v '^expect' > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} extglob.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-extglob2 b/tests/run-extglob2 index 0a6f728e..71d3d809 100644 --- a/tests/run-extglob2 +++ b/tests/run-extglob2 @@ -1,4 +1,4 @@ PATH=$PATH:`pwd` export PATH -${THIS_SH} ./extglob2.tests | grep -v '^expect' > /tmp/xx -diff /tmp/xx extglob2.right && rm -f /tmp/xx +${THIS_SH} ./extglob2.tests | grep -v '^expect' > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} extglob2.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-extglob3 b/tests/run-extglob3 index 26751968..6ebd6747 100644 --- a/tests/run-extglob3 +++ b/tests/run-extglob3 @@ -1,4 +1,4 @@ PATH=$PATH:`pwd` export PATH -${THIS_SH} ./extglob3.tests > /tmp/xx -diff /tmp/xx extglob3.right && rm -f /tmp/xx +${THIS_SH} ./extglob3.tests > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} extglob3.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-func b/tests/run-func index f449eb86..a804364f 100644 --- a/tests/run-func +++ b/tests/run-func @@ -1,5 +1,5 @@ echo "warning: if you have exported functions defined in your environment," >&2 echo "warning: they may show up as diff output." >&2 echo "warning: if so, please do not consider this a test failure" >&2 -${THIS_SH} ./func.tests > /tmp/xx 2>&1 -diff /tmp/xx func.right && rm -f /tmp/xx +${THIS_SH} ./func.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} func.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-getopts b/tests/run-getopts index 1e8b5fb7..4cfc592f 100644 --- a/tests/run-getopts +++ b/tests/run-getopts @@ -1,2 +1,2 @@ -${THIS_SH} ./getopts.tests > /tmp/xx 2>&1 -diff /tmp/xx getopts.right && rm -f /tmp/xx +${THIS_SH} ./getopts.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} getopts.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-glob-test b/tests/run-glob-test index 7a123437..43aa276f 100644 --- a/tests/run-glob-test +++ b/tests/run-glob-test @@ -1,4 +1,4 @@ PATH=$PATH:`pwd` export PATH -${THIS_SH} ./glob.tests 2>&1 | grep -v '^expect' > /tmp/xx -diff /tmp/xx glob.right && rm -f /tmp/xx +${THIS_SH} ./glob.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} glob.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-globstar b/tests/run-globstar index d12cce98..3aa01ed3 100644 --- a/tests/run-globstar +++ b/tests/run-globstar @@ -1,4 +1,4 @@ PATH=$PATH:`pwd` export PATH -${THIS_SH} ./globstar.tests > /tmp/xx 2>&1 -diff /tmp/xx globstar.right && rm -f /tmp/xx +${THIS_SH} ./globstar.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} globstar.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-gprof b/tests/run-gprof index 87d50867..53bdb585 100644 --- a/tests/run-gprof +++ b/tests/run-gprof @@ -1,4 +1,11 @@ #! /bin/sh +: ${TMPDIR:=/tmp} +export TMPDIR + +BASH_TSTOUT=/tmp/xx # for now +export BASH_TSTOUT + +trap 'rm -f $BASH_TSTOUT' 0 PATH=.:$PATH # just to get recho/zecho/printenv if not run via `make tests' export PATH @@ -15,7 +22,7 @@ rm -f gmon.sum ${THIS_SH} ./version -rm -f /tmp/xx +rm -f "$BASH_TSTOUT" # prime the pump; gprof complains if gmon.sum is empty [ -f bash.gmon ] && gprof -s ${THIS_SH} bash.gmon >/dev/null diff --git a/tests/run-heredoc b/tests/run-heredoc index 456453a7..b655c4f8 100644 --- a/tests/run-heredoc +++ b/tests/run-heredoc @@ -2,5 +2,5 @@ echo "warning: UNIX versions number signals and schedule processes differently." echo "warning: If output differing only in line numbers is produced, please" >&2 echo "warning: do not consider this a test failure." >&2 -${THIS_SH} ./heredoc.tests > /tmp/xx 2>&1 -diff /tmp/xx heredoc.right && rm -f /tmp/xx +${THIS_SH} ./heredoc.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} heredoc.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-herestr b/tests/run-herestr index 8c5b36d3..d6def9c6 100644 --- a/tests/run-herestr +++ b/tests/run-herestr @@ -1,2 +1,2 @@ -${THIS_SH} ./herestr.tests > /tmp/xx 2>&1 -diff /tmp/xx herestr.right && rm -f /tmp/xx +${THIS_SH} ./herestr.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} herestr.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-histexpand b/tests/run-histexpand index 06a415bd..a0fc3312 100644 --- a/tests/run-histexpand +++ b/tests/run-histexpand @@ -1,4 +1,4 @@ echo "warning: all of these tests will fail if history has not been compiled" >&2 echo "warning: into the shell" >&2 -${THIS_SH} ./histexp.tests > /tmp/xx 2>&1 -diff /tmp/xx histexp.right && rm -f /tmp/xx +${THIS_SH} ./histexp.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} histexp.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-history b/tests/run-history index ea356b19..f4fa4663 100644 --- a/tests/run-history +++ b/tests/run-history @@ -1,4 +1,4 @@ echo "warning: all of these tests will fail if history has not been compiled" >&2 echo "warning: into the shell" >&2 -${THIS_SH} ./history.tests > /tmp/xx 2>&1 -diff /tmp/xx history.right && rm -f /tmp/xx +${THIS_SH} ./history.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} history.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-ifs b/tests/run-ifs index 3f9d8209..394d9988 100644 --- a/tests/run-ifs +++ b/tests/run-ifs @@ -1,2 +1,2 @@ -${THIS_SH} ./ifs.tests > /tmp/xx 2>&1 -diff /tmp/xx ifs.right && rm -f /tmp/xx +${THIS_SH} ./ifs.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} ifs.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-ifs-posix b/tests/run-ifs-posix index e578e8dd..895c2e2e 100644 --- a/tests/run-ifs-posix +++ b/tests/run-ifs-posix @@ -1,2 +1,2 @@ -${THIS_SH} ./ifs-posix.tests > /tmp/xx 2>&1 -diff /tmp/xx ifs-posix.right && rm -f /tmp/xx +${THIS_SH} ./ifs-posix.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} ifs-posix.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-input-test b/tests/run-input-test index aaa5d35d..412587c5 100644 --- a/tests/run-input-test +++ b/tests/run-input-test @@ -1,2 +1,2 @@ -${THIS_SH} < ./input-line.sh > /tmp/xx -diff /tmp/xx input.right && rm -f /tmp/xx +${THIS_SH} < ./input-line.sh > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} input.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-intl b/tests/run-intl index d4a4de44..c31d1d0a 100644 --- a/tests/run-intl +++ b/tests/run-intl @@ -4,5 +4,5 @@ echo "warning: some of these tests will fail if you do not have UTF-8" >&2 echo "warning: locales installed on your system." >&2 -${THIS_SH} ./intl.tests > /tmp/xx -diff $AFLAG /tmp/xx intl.right && rm -f /tmp/xx +${THIS_SH} ./intl.tests > ${BASH_TSTOUT} +diff $AFLAG ${BASH_TSTOUT} intl.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-invert b/tests/run-invert index 49493076..b2bd06e5 100644 --- a/tests/run-invert +++ b/tests/run-invert @@ -1,2 +1,2 @@ -${THIS_SH} ./invert.tests 2>&1 | grep -v '^expect' > /tmp/xx -diff /tmp/xx invert.right && rm -f /tmp/xx +${THIS_SH} ./invert.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} invert.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-iquote b/tests/run-iquote index 61a8aa77..4fca94a6 100644 --- a/tests/run-iquote +++ b/tests/run-iquote @@ -1,2 +1,2 @@ -${THIS_SH} ./iquote.tests >/tmp/xx 2>&1 -diff /tmp/xx iquote.right && rm -f /tmp/xx +${THIS_SH} ./iquote.tests >${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} iquote.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-jobs b/tests/run-jobs index bfd4fa03..8429b0db 100644 --- a/tests/run-jobs +++ b/tests/run-jobs @@ -3,5 +3,5 @@ echo "warning: into the shell" >&2 echo "warning: there may be a message regarding a cat process dying due to a" >&2 echo "warning: SIGHUP. Please disregard." >&2 -${THIS_SH} ./jobs.tests > /tmp/xx 2>&1 -diff /tmp/xx jobs.right && rm -f /tmp/xx +${THIS_SH} ./jobs.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} jobs.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-lastpipe b/tests/run-lastpipe index 92ac030f..2edf5c43 100644 --- a/tests/run-lastpipe +++ b/tests/run-lastpipe @@ -1,2 +1,2 @@ -${THIS_SH} ./lastpipe.tests > /tmp/xx 2>&1 -diff /tmp/xx lastpipe.right && rm -f /tmp/xx +${THIS_SH} ./lastpipe.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} lastpipe.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-mapfile b/tests/run-mapfile index a207f09c..e5d1b384 100644 --- a/tests/run-mapfile +++ b/tests/run-mapfile @@ -1,2 +1,2 @@ -${THIS_SH} ./mapfile.tests > /tmp/xx 2>&1 -diff /tmp/xx mapfile.right && rm -f /tmp/xx +${THIS_SH} ./mapfile.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} mapfile.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-minimal b/tests/run-minimal index de983447..4ab9f3c2 100644 --- a/tests/run-minimal +++ b/tests/run-minimal @@ -3,6 +3,15 @@ # run-minimal - a version of run-all for shells configured with # --enable-minimal-config # + +: ${TMPDIR:=/tmp} +export TMPDIR + +BASH_TSTOUT=/tmp/xx # for now +export BASH_TSTOUT + +trap 'rm -f $BASH_TSTOUT' 0 + PATH=.:$PATH # just to get the right version of printenv export PATH @@ -16,7 +25,7 @@ export THIS_SH ${THIS_SH} ./version.mini -rm -f /tmp/xx +rm -f "$BASH_TSTOUT" echo Testing ${THIS_SH} echo Any output from any test, unless otherwise noted, indicates a possible anomaly diff --git a/tests/run-more-exp b/tests/run-more-exp index 60f55cb6..0424a2fb 100644 --- a/tests/run-more-exp +++ b/tests/run-more-exp @@ -1,2 +1,2 @@ -${THIS_SH} ./more-exp.tests 2>&1 | grep -v '^expect' > /tmp/xx -diff /tmp/xx more-exp.right && rm -f /tmp/xx +${THIS_SH} ./more-exp.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} more-exp.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-nameref b/tests/run-nameref index 40f00d52..b73e1b8c 100644 --- a/tests/run-nameref +++ b/tests/run-nameref @@ -1,4 +1,4 @@ echo "warning: some of these tests will fail if arrays have not" >&2 echo "warning: been compiled into the shell" >&2 -${THIS_SH} ./nameref.tests > /tmp/xx 2>&1 -diff /tmp/xx nameref.right && rm -f /tmp/xx +${THIS_SH} ./nameref.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} nameref.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-new-exp b/tests/run-new-exp index 2e3d7c9d..8777c7bd 100644 --- a/tests/run-new-exp +++ b/tests/run-new-exp @@ -6,5 +6,5 @@ echo "warning: if you have exported variables beginning with the string _Q," >&2 echo "warning: diff output may be generated. If so, please do not consider" >&2 echo "warning: this a test failure" >&2 -${THIS_SH} ./new-exp.tests 2>&1 | grep -v '^expect' > /tmp/xx -diff /tmp/xx new-exp.right && rm -f /tmp/xx +${THIS_SH} ./new-exp.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} new-exp.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-nquote b/tests/run-nquote index 006872c8..03954b8b 100644 --- a/tests/run-nquote +++ b/tests/run-nquote @@ -1,2 +1,2 @@ -${THIS_SH} ./nquote.tests 2>&1 | grep -v '^expect' > /tmp/xx -diff /tmp/xx nquote.right && rm -f /tmp/xx +${THIS_SH} ./nquote.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} nquote.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-nquote1 b/tests/run-nquote1 index a71740fd..bd9e9398 100644 --- a/tests/run-nquote1 +++ b/tests/run-nquote1 @@ -1,4 +1,4 @@ echo "warning: several of these tests will fail if arrays have not" >&2 echo "warning: been compiled into the shell." >&2 -${THIS_SH} ./nquote1.tests 2>&1 | grep -v '^expect' > /tmp/xx -diff /tmp/xx nquote1.right && rm -f /tmp/xx +${THIS_SH} ./nquote1.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} nquote1.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-nquote2 b/tests/run-nquote2 index 80d1a8da..4648d3ee 100644 --- a/tests/run-nquote2 +++ b/tests/run-nquote2 @@ -1,4 +1,4 @@ echo "warning: several of these tests will fail if arrays have not" >&2 echo "warning: been compiled into the shell." >&2 -${THIS_SH} ./nquote2.tests 2>&1 | grep -v '^expect' > /tmp/xx -diff /tmp/xx nquote2.right && rm -f /tmp/xx +${THIS_SH} ./nquote2.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} nquote2.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-nquote3 b/tests/run-nquote3 index 45ba5f7e..4a3e32af 100644 --- a/tests/run-nquote3 +++ b/tests/run-nquote3 @@ -1,4 +1,4 @@ echo "warning: several of these tests will fail if arrays have not" >&2 echo "warning: been compiled into the shell." >&2 -${THIS_SH} ./nquote3.tests 2>&1 | grep -v '^expect' > /tmp/xx -diff /tmp/xx nquote3.right && rm -f /tmp/xx +${THIS_SH} ./nquote3.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} nquote3.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-nquote4 b/tests/run-nquote4 index 493f4aa1..44baac4c 100644 --- a/tests/run-nquote4 +++ b/tests/run-nquote4 @@ -1,4 +1,4 @@ echo warning: some of these tests will fail if you do not have UTF-8 >&2 echo warning: locales installed on your system >&2 -${THIS_SH} ./nquote4.tests 2>&1 | grep -v '^expect' > /tmp/xx -diff /tmp/xx nquote4.right && rm -f /tmp/xx +${THIS_SH} ./nquote4.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} nquote4.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-nquote5 b/tests/run-nquote5 index 14cef64c..1d4c4aa2 100644 --- a/tests/run-nquote5 +++ b/tests/run-nquote5 @@ -1,2 +1,2 @@ -${THIS_SH} ./nquote5.tests 2>&1 | grep -v '^expect' > /tmp/xx -diff /tmp/xx nquote5.right && rm -f /tmp/xx +${THIS_SH} ./nquote5.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} nquote5.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-parser b/tests/run-parser index 7834c911..ea1ec490 100644 --- a/tests/run-parser +++ b/tests/run-parser @@ -1,2 +1,2 @@ -${THIS_SH} ./parser.tests > /tmp/xx 2>&1 -diff /tmp/xx parser.right && rm -f /tmp/xx +${THIS_SH} ./parser.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} parser.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-posix2 b/tests/run-posix2 index 52eea2fa..cfa95719 100644 --- a/tests/run-posix2 +++ b/tests/run-posix2 @@ -1,2 +1,2 @@ -${THIS_SH} ./posix2.tests 2>&1 | grep -v '^expect' > /tmp/xx -diff /tmp/xx posix2.right && rm -f /tmp/xx +${THIS_SH} ./posix2.tests 2>&1 | grep -v '^expect' > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} posix2.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-posixexp b/tests/run-posixexp index e5a1c3e5..827b0e4c 100644 --- a/tests/run-posixexp +++ b/tests/run-posixexp @@ -1,2 +1,2 @@ -${THIS_SH} ./posixexp.tests > /tmp/xx 2>&1 -diff /tmp/xx posixexp.right && rm -f /tmp/xx +${THIS_SH} ./posixexp.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} posixexp.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-posixexp2 b/tests/run-posixexp2 index 9a2890f9..1e6b2d90 100644 --- a/tests/run-posixexp2 +++ b/tests/run-posixexp2 @@ -1,2 +1,2 @@ -${THIS_SH} ./posixexp2.tests > /tmp/xx 2>&1 -diff /tmp/xx posixexp2.right && rm -f /tmp/xx +${THIS_SH} ./posixexp2.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} posixexp2.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-posixpat b/tests/run-posixpat index ef2b140d..8937948c 100644 --- a/tests/run-posixpat +++ b/tests/run-posixpat @@ -1,2 +1,2 @@ -${THIS_SH} ./posixpat.tests > /tmp/xx -diff /tmp/xx posixpat.right && rm -f /tmp/xx +${THIS_SH} ./posixpat.tests > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} posixpat.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-posixpipe b/tests/run-posixpipe index c574535e..5f099e2a 100644 --- a/tests/run-posixpipe +++ b/tests/run-posixpipe @@ -1,2 +1,2 @@ -${THIS_SH} ./posixpipe.tests > /tmp/xx 2>&1 -diff /tmp/xx posixpipe.right && rm -f /tmp/xx +${THIS_SH} ./posixpipe.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} posixpipe.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-precedence b/tests/run-precedence index d81a8688..de33224e 100644 --- a/tests/run-precedence +++ b/tests/run-precedence @@ -1,2 +1,2 @@ -${THIS_SH} ./precedence > /tmp/xx -diff /tmp/xx prec.right && rm -f /tmp/xx +${THIS_SH} ./precedence > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} prec.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-printf b/tests/run-printf index 7b152a12..e242787c 100644 --- a/tests/run-printf +++ b/tests/run-printf @@ -2,6 +2,6 @@ #( diff -a ./printf.tests ./printf.tests >/dev/null 2>&1 ) && AFLAG=-a # use cat -v (and assume it's there) to make control chars visible -${THIS_SH} ./printf.tests 2>&1 | cat -v > /tmp/xx -#diff $AFLAG /tmp/xx printf.right && rm -f /tmp/xx -diff /tmp/xx printf.right && rm -f /tmp/xx +${THIS_SH} ./printf.tests 2>&1 | cat -v > ${BASH_TSTOUT} +#diff $AFLAG ${BASH_TSTOUT} printf.right && rm -f ${BASH_TSTOUT} +diff ${BASH_TSTOUT} printf.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-quote b/tests/run-quote index 69050428..2543666f 100644 --- a/tests/run-quote +++ b/tests/run-quote @@ -1,2 +1,2 @@ -${THIS_SH} ./quote.tests >/tmp/xx 2>&1 -diff /tmp/xx quote.right && rm -f /tmp/xx +${THIS_SH} ./quote.tests >${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} quote.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-read b/tests/run-read index 47e4188b..5ec07e27 100644 --- a/tests/run-read +++ b/tests/run-read @@ -1,4 +1,4 @@ echo "warning: please do not consider output differing only in the amount of" >&2 echo "warning: white space to be an error." >&2 -${THIS_SH} ./read.tests > /tmp/xx 2>&1 -diff /tmp/xx read.right && rm -f /tmp/xx +${THIS_SH} ./read.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} read.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-redir b/tests/run-redir index 2be45dd6..071af6eb 100644 --- a/tests/run-redir +++ b/tests/run-redir @@ -3,5 +3,5 @@ echo "warning: produce diff output." >&2 echo "warning: if the text of an error message concerning \`redir1.*' not being" >&2 echo "warning: found or messages concerning bad file descriptors produce diff" >&2 echo "warning: output, please do not consider it a test failure" >&2 -${THIS_SH} ./redir.tests > /tmp/xx 2>&1 -diff /tmp/xx redir.right && rm -f /tmp/xx +${THIS_SH} ./redir.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} redir.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-rhs-exp b/tests/run-rhs-exp index 1f89d0b6..de8ae0ea 100644 --- a/tests/run-rhs-exp +++ b/tests/run-rhs-exp @@ -1,2 +1,2 @@ -${THIS_SH} ./rhs-exp.tests 2>&1 > /tmp/xx -diff /tmp/xx rhs-exp.right && rm -f /tmp/xx +${THIS_SH} ./rhs-exp.tests 2>&1 > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} rhs-exp.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-rsh b/tests/run-rsh index ef235837..67706996 100644 --- a/tests/run-rsh +++ b/tests/run-rsh @@ -1,2 +1,2 @@ -${THIS_SH} ./rsh.tests > /tmp/xx 2>&1 -diff /tmp/xx rsh.right && rm -f /tmp/xx +${THIS_SH} ./rsh.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} rsh.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-set-e b/tests/run-set-e index 3389f118..eed17fa5 100644 --- a/tests/run-set-e +++ b/tests/run-set-e @@ -1,2 +1,2 @@ -${THIS_SH} ./set-e.tests > /tmp/xx -diff /tmp/xx set-e.right && rm -f /tmp/xx +${THIS_SH} ./set-e.tests > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} set-e.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-set-x b/tests/run-set-x old mode 100755 new mode 100644 diff --git a/tests/run-shopt b/tests/run-shopt index 100a3de0..02c43e71 100644 --- a/tests/run-shopt +++ b/tests/run-shopt @@ -1,2 +1,2 @@ -${THIS_SH} ./shopt.tests > /tmp/xx 2>&1 -diff /tmp/xx shopt.right && rm -f /tmp/xx +${THIS_SH} ./shopt.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} shopt.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-strip b/tests/run-strip index 0d321152..46a9da9c 100644 --- a/tests/run-strip +++ b/tests/run-strip @@ -1,2 +1,2 @@ -${THIS_SH} ./strip.tests > /tmp/xx -diff /tmp/xx strip.right && rm -f /tmp/xx +${THIS_SH} ./strip.tests > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} strip.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-test b/tests/run-test index b2482c3f..d68791ca 100644 --- a/tests/run-test +++ b/tests/run-test @@ -1,4 +1,4 @@ unset GROUPS UID 2>/dev/null -${THIS_SH} ./test.tests >/tmp/xx 2>&1 -diff /tmp/xx test.right && rm -f /tmp/xx +${THIS_SH} ./test.tests >${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} test.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-tilde b/tests/run-tilde index b8569c11..9460225b 100644 --- a/tests/run-tilde +++ b/tests/run-tilde @@ -1,2 +1,2 @@ -${THIS_SH} ./tilde.tests > /tmp/xx -diff /tmp/xx tilde.right && rm -f /tmp/xx +${THIS_SH} ./tilde.tests > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} tilde.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-tilde2 b/tests/run-tilde2 index 4446989d..fa7e7d6c 100644 --- a/tests/run-tilde2 +++ b/tests/run-tilde2 @@ -1,2 +1,2 @@ -${THIS_SH} ./tilde2.tests > /tmp/xx -diff /tmp/xx tilde2.right && rm -f /tmp/xx +${THIS_SH} ./tilde2.tests > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} tilde2.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-trap b/tests/run-trap index 14f68740..e3331ed0 100644 --- a/tests/run-trap +++ b/tests/run-trap @@ -2,5 +2,5 @@ echo "warning: UNIX versions number signals and schedule processes differently." echo "warning: If output differing only in line numbers is produced, please" >&2 echo "warning: do not consider this a test failure." >&2 -${THIS_SH} ./trap.tests > /tmp/xx 2>&1 -diff /tmp/xx trap.right && rm -f /tmp/xx +${THIS_SH} ./trap.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} trap.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-type b/tests/run-type index 4d195b01..499cb4ed 100644 --- a/tests/run-type +++ b/tests/run-type @@ -1,2 +1,2 @@ -${THIS_SH} ./type.tests > /tmp/xx 2>&1 -diff /tmp/xx type.right && rm -f /tmp/xx +${THIS_SH} ./type.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} type.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-varenv b/tests/run-varenv index 951c44fe..5987a7f3 100644 --- a/tests/run-varenv +++ b/tests/run-varenv @@ -1,2 +1,2 @@ -${THIS_SH} ./varenv.sh 2>&1 | grep -v '^expect' > /tmp/xx -diff /tmp/xx varenv.right && rm -f /tmp/xx +${THIS_SH} ./varenv.sh 2>&1 | grep -v '^expect' > ${BASH_TSTOUT} +diff ${BASH_TSTOUT} varenv.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-vredir b/tests/run-vredir index 9a963772..2a4faf30 100644 --- a/tests/run-vredir +++ b/tests/run-vredir @@ -1,2 +1,2 @@ -${THIS_SH} ./vredir.tests > /tmp/xx 2>&1 -diff /tmp/xx vredir.right && rm -f /tmp/xx +${THIS_SH} ./vredir.tests > ${BASH_TSTOUT} 2>&1 +diff ${BASH_TSTOUT} vredir.right && rm -f ${BASH_TSTOUT} diff --git a/trap.c b/trap.c index eed53923..8162bbfe 100644 --- a/trap.c +++ b/trap.c @@ -605,6 +605,13 @@ set_error_trap (command) set_signal (ERROR_TRAP, command); } +void +maybe_set_error_trap (command) + char *command; +{ + trap_if_untrapped (ERROR_TRAP, command); +} + void set_return_trap (command) char *command; diff --git a/trap.h b/trap.h index f8c7736e..1de190b6 100644 --- a/trap.h +++ b/trap.h @@ -75,6 +75,7 @@ extern void set_error_trap __P((char *)); extern void set_return_trap __P((char *)); extern void maybe_set_debug_trap __P((char *)); +extern void maybe_set_error_trap __P((char *)); extern void set_sigint_trap __P((char *)); extern void set_signal __P((int, char *));