mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-29 08:29:54 +02:00
commit bash-20180418 snapshot
This commit is contained in:
@@ -15252,4 +15252,20 @@ parse.y
|
||||
and CTLNUL in the input. Fixes bug with ^A in here document reported
|
||||
by Jorge Alberto Baca Garcia <bacagarcia@me.com>
|
||||
|
||||
4/18
|
||||
----
|
||||
pathexp.c
|
||||
- quote_string_for_globbing: make sure the QGLOB_CTLESC code handles
|
||||
both CTLESC CTLESC and CTLESC CTLNUL in the same way. Fixes bug
|
||||
reported by Martijn Dekker <martijn@inlv.org>
|
||||
|
||||
4/19
|
||||
----
|
||||
execute_cmd.c
|
||||
- execute_command_internal: before executing any command in the current
|
||||
shell, and before copying any existing FIFO list, call
|
||||
reap_procsubs to unlink or close any process substitution pipes
|
||||
associated with processes that have exited. Fixes hang in test suite
|
||||
when trying to open a FIFO with no process having it open for
|
||||
reading
|
||||
|
||||
|
||||
+7
-3
@@ -744,6 +744,10 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
|
||||
stdin_redir = stdin_redirects (command->redirects);
|
||||
|
||||
#if defined (PROCESS_SUBSTITUTION)
|
||||
# if !defined (HAVE_DEV_FD)
|
||||
reap_procsubs ();
|
||||
# endif
|
||||
|
||||
if (variable_context != 0)
|
||||
{
|
||||
ofifo = num_fifos ();
|
||||
@@ -3473,9 +3477,9 @@ execute_case_command (case_command)
|
||||
/* Convert quoted null strings into empty strings. */
|
||||
qflags = QGLOB_CVTNULL;
|
||||
|
||||
/* We left CTLESC in place quoting CTLESC after the call to
|
||||
expand_word_leave_quoted; tell quote_string_for_globbing to
|
||||
remove those here. This works for both unquoted portions of
|
||||
/* We left CTLESC in place quoting CTLESC and CTLNUL after the
|
||||
call to expand_word_leave_quoted; tell quote_string_for_globbing
|
||||
to remove those here. This works for both unquoted portions of
|
||||
the word (which call quote_escapes) and quoted portions
|
||||
(which call quote_string). */
|
||||
qflags |= QGLOB_CTLESC;
|
||||
|
||||
@@ -205,7 +205,7 @@ quote_string_for_globbing (pathname, qflags)
|
||||
}
|
||||
/* If we are parsing regexp, turn CTLESC CTLESC into CTLESC. It's not an
|
||||
ERE special character, so we should just be able to pass it through. */
|
||||
else if ((qflags & (QGLOB_REGEXP|QGLOB_CTLESC)) && pathname[i] == CTLESC && pathname[i+1] == CTLESC)
|
||||
else if ((qflags & (QGLOB_REGEXP|QGLOB_CTLESC)) && pathname[i] == CTLESC && (pathname[i+1] == CTLESC || pathname[i+1] == CTLNUL))
|
||||
{
|
||||
i++;
|
||||
temp[j++] = pathname[i];
|
||||
@@ -326,8 +326,8 @@ quote_string_for_globbing (pathname, qflags)
|
||||
break;
|
||||
/* If we are turning CTLESC CTLESC into CTLESC, we need to do that
|
||||
even when the first CTLESC is preceded by a backslash. */
|
||||
if ((qflags & QGLOB_CTLESC) && pathname[i] == CTLESC && pathname[i+1] == CTLESC)
|
||||
i++; /* skip over one of the CTLESCs */
|
||||
if ((qflags & QGLOB_CTLESC) && pathname[i] == CTLESC && (pathname[i+1] == CTLESC || pathname[i+1] == CTLNUL))
|
||||
i++; /* skip over the CTLESC */
|
||||
}
|
||||
else if (pathname[i] == '\\' && (qflags & QGLOB_REGEXP))
|
||||
last_was_backslash = 1;
|
||||
|
||||
@@ -5392,7 +5392,7 @@ find_procsub_child (pid)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nfifo; i++)
|
||||
if ((fifo_list[i].proc == pid)
|
||||
if (fifo_list[i].proc == pid)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
@@ -5422,7 +5422,7 @@ reap_procsubs ()
|
||||
void
|
||||
wait_procsubs ()
|
||||
{
|
||||
int i;
|
||||
int i, r;
|
||||
|
||||
for (i = 0; i < nfifo; i++)
|
||||
{
|
||||
|
||||
Executable → Regular
+49
-42
@@ -1,7 +1,5 @@
|
||||
#!/bin/sh -
|
||||
#
|
||||
# BSDI $Id: mkdep.gcc.sh,v 2.1 1995/02/03 12:54:13 polk Exp $
|
||||
#
|
||||
# Copyright (c) 1991, 1993
|
||||
# The Regents of the University of California. All rights reserved.
|
||||
#
|
||||
@@ -13,10 +11,6 @@
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. All advertising materials mentioning features or use of this software
|
||||
# must display the following acknowledgement:
|
||||
# This product includes software developed by the University of
|
||||
# California, Berkeley and its contributors.
|
||||
# 4. Neither the name of the University nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
@@ -33,59 +27,72 @@
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
# @(#)mkdep.gcc.sh 8.1 (Berkeley) 6/6/93
|
||||
# $FreeBSD: stable/11/usr.bin/mkdep/mkdep.sh 216370 2010-12-11 08:32:16Z joel $
|
||||
#
|
||||
# @(#)mkdep.sh 8.1 (Berkeley) 6/6/93
|
||||
#
|
||||
|
||||
PATH=/bin:/usr/bin:/usr/gnu/bin:/usr/local/bin:/usr/local/bin/gnu
|
||||
PATH=/bin:/usr/bin:/usr/ucb:/usr/old/bin
|
||||
export PATH
|
||||
|
||||
cpp=${CPP:-gcc}
|
||||
#trad="-notraditional"
|
||||
|
||||
D=depends # default dependency file is depends
|
||||
D=.depend # default dependency file is .depend
|
||||
append=0
|
||||
pflag=
|
||||
|
||||
usage()
|
||||
{
|
||||
echo 'usage: mkdep [-t] [-p] [-f depend_file] [-c compiler] [cc_flags] file ...' >&2
|
||||
}
|
||||
while :
|
||||
do case "$1" in
|
||||
# -a appends to the depend file
|
||||
-a)
|
||||
append=1
|
||||
shift ;;
|
||||
|
||||
while getopts "2af:c:pt" opt; do
|
||||
case "$opt" in
|
||||
# -2 => gcc2 -- this option is temporary, hence not documented
|
||||
2) cpp=${CPP:-gcc2} ; trad= ;;
|
||||
# -a appends to the depend file
|
||||
a) append=1;;
|
||||
# -c specifies the compiler to use
|
||||
c) CPP=$OPTARG ;;
|
||||
# -f allows you to select a makefile name
|
||||
f) D=$OPTARG ;;
|
||||
# the -p flag produces "program: program.c" style dependencies
|
||||
# so .o's don't get produced
|
||||
p) pflag=p ;;
|
||||
# -t means use -traditional with gnu cpp
|
||||
t) trad="-traditional" ;;
|
||||
\?) usage ; exit 2;;
|
||||
# -f allows you to select a makefile name
|
||||
-f)
|
||||
D=$2
|
||||
shift; shift ;;
|
||||
|
||||
# the -p flag produces "program: program.c" style dependencies
|
||||
# so .o's don't get produced
|
||||
-p)
|
||||
SED='s;\.o ; ;'
|
||||
shift ;;
|
||||
*)
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $(( $OPTIND - 1 ))
|
||||
|
||||
if [ $# = 0 ] ; then
|
||||
usage
|
||||
echo 'usage: mkdep [-p] [-f depend_file] [cc_flags] file ...'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TMP=/tmp/mkdep$$
|
||||
|
||||
trap 'rm -f $TMP ; exit 1' 1 2 3 13 15
|
||||
trap 'rm -f $TMP ; trap 2 ; kill -2 $$' 1 2 3 13 15
|
||||
|
||||
if [ x$pflag = x ]; then
|
||||
$cpp $trad -M $* | sed -e 's; \./; ;g' > $TMP
|
||||
else
|
||||
$cpp $trad -M $* | sed -e 's;\.o *:;:;' -e 's; \./; ;g' > $TMP
|
||||
fi
|
||||
cc -M $* |
|
||||
sed "
|
||||
s; \./; ;g
|
||||
/\.c:$/d
|
||||
$SED" |
|
||||
awk '{
|
||||
if ($1 != prev) {
|
||||
if (rec != "")
|
||||
print rec;
|
||||
rec = $0;
|
||||
prev = $1;
|
||||
}
|
||||
else {
|
||||
if (length(rec $2) > 78) {
|
||||
print rec;
|
||||
rec = $0;
|
||||
}
|
||||
else
|
||||
rec = rec " " $2
|
||||
}
|
||||
}
|
||||
END {
|
||||
print rec
|
||||
}' > $TMP
|
||||
|
||||
if [ $? != 0 ]; then
|
||||
echo 'mkdep: compile failed.'
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
@@ -52,3 +52,11 @@ ok1ok2ok3ok4ok5
|
||||
ok1ok2ok3ok4ok5
|
||||
ok1ok2ok3ok4ok5
|
||||
ok1ok2ok3ok4ok5
|
||||
--- testing: del
|
||||
ok1ok2ok3ok4ok5
|
||||
ok1ok2ok3ok4ok5
|
||||
ok1ok2ok3ok4ok5
|
||||
ok1ok2ok3ok4ok5
|
||||
ok1ok2ok3ok4ok5
|
||||
ok1ok2ok3ok4ok5
|
||||
ok1ok2ok3ok4ok5
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ testmatch() {
|
||||
echo
|
||||
}
|
||||
|
||||
for c in $'\1' $'\2'; do
|
||||
for c in $'\1' $'\2' $'\177'; do
|
||||
echo -n "--- testing: "
|
||||
echo "$c" | od -t a | awk 'NR==1 { print $2 } '
|
||||
testmatch "${c}" "\\${c}"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
: ${TMPDIR:=/var/tmp}
|
||||
TMPFILE=$TMPDIR/exitcode
|
||||
trap 'rm -f $TMPFILE' 0
|
||||
|
||||
rm -f $TMPFILE
|
||||
set -e
|
||||
|
||||
@@ -15,3 +15,4 @@ echo *
|
||||
rm ';' '++'
|
||||
|
||||
cd $OLDPWD
|
||||
rmdir $TESTDIR
|
||||
|
||||
+2
-2
@@ -97,7 +97,7 @@ line 2 for history
|
||||
6 HISTFILE=$TMPDIR/newhistory
|
||||
7 echo displaying \$HISTFILE after history -a
|
||||
8 cat $HISTFILE
|
||||
./history.tests: line 75: fc: history specification out of range
|
||||
./history.tests: line 76: fc: history specification out of range
|
||||
14 set -H
|
||||
15 echo line 2 for history
|
||||
16 unset HISTSIZE
|
||||
@@ -107,7 +107,7 @@ echo xx xb xc
|
||||
xx xb xc
|
||||
echo 44 48 4c
|
||||
44 48 4c
|
||||
./history.tests: line 90: fc: no command found
|
||||
./history.tests: line 91: fc: no command found
|
||||
aa
|
||||
bb
|
||||
cc
|
||||
|
||||
@@ -20,6 +20,7 @@ HISTFILE=history.list
|
||||
HISTCONTROL=ignoreboth
|
||||
HISTIGNORE='&:history*:fc*'
|
||||
HISTSIZE=32
|
||||
export HISTIGNORE
|
||||
|
||||
shopt -s cmdhist
|
||||
set -o history
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ SUFFIX=`${THIS_SH} -c 'echo $(( $RANDOM + $BASHPID ))'`
|
||||
BASH_TSTOUT=${TMPDIR}/bashtst-$SUFFIX # for now
|
||||
export BASH_TSTOUT
|
||||
|
||||
trap 'rm -f $BASH_TSTOUT' 0
|
||||
trap 'rm -f $BASH_TSTOUT' 0 1 2 3 15
|
||||
|
||||
PATH=.:$PATH # just to get recho/zecho/printenv if not run via `make tests'
|
||||
export PATH
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
# return different results
|
||||
: ${TMPDIR:=/tmp}
|
||||
|
||||
trap 'rm -f ${TMPDIR}/pipe}' 0 1 2 3 6 15
|
||||
trap 'rm -f ${TMPDIR}/pipe' 0 1 2 3 6 15
|
||||
|
||||
exec 6>&-
|
||||
echo "t -p /dev/fd/6"
|
||||
|
||||
Reference in New Issue
Block a user