mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-24 06:17:57 +02:00
commit bash-20191108 snapshot
This commit is contained in:
@@ -6803,3 +6803,37 @@ subst.c
|
||||
string_list (and then quote_string_for_globbing, since QGLOB_CVTNULL
|
||||
only handles pat[0] == CTLNUL). Fixes bug reported by Oguz
|
||||
<oguzismailuysal@gmail.com>
|
||||
|
||||
11/4
|
||||
----
|
||||
configure.ac,config.h.in
|
||||
- AC_HEADER_MAJOR: look for `major' and `minor' in various header files
|
||||
and define MAJOR_IN_MAKEDEV or MAJOR_IN_SYSMACROS as appropriate.
|
||||
From a patch from Eli Schwartz <eschwartz@archlinux.org>
|
||||
|
||||
examples/loadables/finfo.c
|
||||
- include <sys/mkdev.h> and <sys/sysmacros.h> as appropriate for
|
||||
definitions of major/minor
|
||||
|
||||
11/6
|
||||
----
|
||||
redir.c
|
||||
- heredoc_expand: if we are expanding the WORD in a here-string, use
|
||||
expand_assignment_string_to_string so the expansions are consistent
|
||||
in contexts where word splitting is not performed. From a bug report
|
||||
by Robin A. Meade <robin.a.meade@gmail.com>
|
||||
|
||||
11/7
|
||||
----
|
||||
parse.y
|
||||
- xparse_dolparen: if the command substitution is incomplete or doesn't
|
||||
end in `)', print an error message instead of allowing EOS to
|
||||
terminate the comsub. From a bug report from
|
||||
Oguz <oguzismailuysal@gmail.com>
|
||||
|
||||
11/11
|
||||
-----
|
||||
lib/sh/unicode.c
|
||||
- u32toutf8: fix a typo that assigned the wrong value to the first
|
||||
byte of a six-byte UTF-8 character. Report and fix from
|
||||
Istv谩n P谩sztor <pasztorpisti@gmail.com>
|
||||
|
||||
@@ -967,6 +967,7 @@ tests/comsub-eof2.sub f
|
||||
tests/comsub-eof3.sub f
|
||||
tests/comsub-eof4.sub f
|
||||
tests/comsub-eof5.sub f
|
||||
tests/comsub-eof6.sub f
|
||||
tests/comsub-eof.right f
|
||||
tests/comsub-posix.tests f
|
||||
tests/comsub-posix.right f
|
||||
@@ -1105,6 +1106,7 @@ tests/glob4.sub f
|
||||
tests/glob5.sub f
|
||||
tests/glob6.sub f
|
||||
tests/glob7.sub f
|
||||
tests/glob8.sub f
|
||||
tests/glob.right f
|
||||
tests/globstar.tests f
|
||||
tests/globstar.right f
|
||||
|
||||
@@ -611,7 +611,7 @@ itrace("parse_string: longjmp executed: code = %d", code);
|
||||
break;
|
||||
}
|
||||
|
||||
out:
|
||||
out:
|
||||
|
||||
global_command = oglobal;
|
||||
nc = bash_input.location.string - ostring;
|
||||
|
||||
@@ -285,6 +285,11 @@
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define if major/minor/makedev is defined in <sys/mkdev.h> */
|
||||
#undef MAJOR_IN_MAKEDEV
|
||||
|
||||
/* Define if major/minor/makedev is defined in <sys/sysmacros.h> */
|
||||
#undef MAJOR_IN_SYSMACROS
|
||||
|
||||
/* SYSTEM TYPES */
|
||||
|
||||
|
||||
@@ -13258,6 +13258,56 @@ $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines makedev" >&5
|
||||
$as_echo_n "checking whether sys/types.h defines makedev... " >&6; }
|
||||
if ${ac_cv_header_sys_types_h_makedev+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <sys/types.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return makedev(0, 0);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
ac_cv_header_sys_types_h_makedev=yes
|
||||
else
|
||||
ac_cv_header_sys_types_h_makedev=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_types_h_makedev" >&5
|
||||
$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; }
|
||||
|
||||
if test $ac_cv_header_sys_types_h_makedev = no; then
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_sys_mkdev_h" = xyes; then :
|
||||
|
||||
$as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test $ac_cv_header_sys_mkdev_h = no; then
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then :
|
||||
|
||||
$as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
for ac_header in inttypes.h
|
||||
|
||||
@@ -743,6 +743,7 @@ AM_GNU_GETTEXT([no-libtool], [need-ngettext], [lib/intl])
|
||||
dnl header files
|
||||
AC_HEADER_DIRENT
|
||||
AC_HEADER_TIME
|
||||
AC_HEADER_MAJOR
|
||||
|
||||
BASH_HEADER_INTTYPES
|
||||
|
||||
|
||||
@@ -28,6 +28,12 @@
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef MAJOR_IN_MKDEV
|
||||
# include <sys/mkdev.h>
|
||||
#endif
|
||||
#ifdef MAJOR_IN_SYSMACROS
|
||||
# include <sys/sysmacros.h>
|
||||
#endif
|
||||
#include "posixstat.h"
|
||||
#include <stdio.h>
|
||||
#include <pwd.h>
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/* unicode.c - functions to convert unicode characters */
|
||||
|
||||
/* Copyright (C) 2010-2016 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2010-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -196,7 +196,7 @@ u32toutf8 (wc, s)
|
||||
}
|
||||
else if (wc < 0x080000000)
|
||||
{
|
||||
s[0] = (wc >> 30) | 0xf8;
|
||||
s[0] = (wc >> 30) | 0xfc;
|
||||
s[1] = ((wc >> 24) & 0x3f) | 0x80;
|
||||
s[2] = ((wc >> 18) & 0x3f) | 0x80;
|
||||
s[3] = ((wc >> 12) & 0x3f) | 0x80;
|
||||
|
||||
@@ -4415,7 +4415,7 @@ xparse_dolparen (base, string, indp, flags)
|
||||
{
|
||||
sh_parser_state_t ps;
|
||||
sh_input_line_state_t ls;
|
||||
int orig_ind, nc, sflags, orig_eof_token;
|
||||
int orig_ind, nc, sflags, orig_eof_token, start_lineno;
|
||||
char *ret, *ep, *ostring;
|
||||
#if defined (ALIAS) || defined (DPAREN_ARITHMETIC)
|
||||
STRING_SAVER *saved_pushed_strings;
|
||||
@@ -4424,6 +4424,7 @@ xparse_dolparen (base, string, indp, flags)
|
||||
/*debug_parser(1);*/
|
||||
orig_ind = *indp;
|
||||
ostring = string;
|
||||
start_lineno = line_number;
|
||||
|
||||
if (*string == 0)
|
||||
{
|
||||
@@ -4493,13 +4494,14 @@ xparse_dolparen (base, string, indp, flags)
|
||||
if (ep[-1] != '\n')
|
||||
itrace("xparse_dolparen:%d: ep[-1] != RPAREN (%d), ep = `%s'", line_number, ep[-1], ep);
|
||||
#endif
|
||||
|
||||
while (ep > ostring && ep[-1] == '\n') ep--;
|
||||
}
|
||||
|
||||
nc = ep - ostring;
|
||||
*indp = ep - base - 1;
|
||||
|
||||
/*(*/
|
||||
/*((*/
|
||||
#if DEBUG
|
||||
if (base[*indp] != ')')
|
||||
itrace("xparse_dolparen:%d: base[%d] != RPAREN (%d), base = `%s'", line_number, *indp, base[*indp], base);
|
||||
@@ -4507,6 +4509,13 @@ xparse_dolparen (base, string, indp, flags)
|
||||
itrace("xparse_dolparen:%d: *indp (%d) < orig_ind (%d), orig_string = `%s'", line_number, *indp, orig_ind, ostring);
|
||||
#endif
|
||||
|
||||
if (base[*indp] != ')')
|
||||
{
|
||||
/*(*/
|
||||
parser_error (start_lineno, _("unexpected EOF while looking for matching `%c'"), ')');
|
||||
jump_to_top_level (DISCARD);
|
||||
}
|
||||
|
||||
if (flags & SX_NOALLOC)
|
||||
return (char *)NULL;
|
||||
|
||||
|
||||
@@ -367,7 +367,7 @@ heredoc_expand (redirectee, ri, lenp)
|
||||
/* Now that we've changed the variable search order to ignore the temp
|
||||
environment, see if we need to change the cached IFS values. */
|
||||
sv_ifs ("IFS");
|
||||
document = (ri == r_reading_string) ? expand_string_unsplit_to_string (redirectee->word, 0)
|
||||
document = (ri == r_reading_string) ? expand_assignment_string_to_string (redirectee->word, 0)
|
||||
: expand_string_to_string (redirectee->word, Q_HERE_DOCUMENT);
|
||||
expanding_redir = 0;
|
||||
/* Now we need to change the variable search order back to include the temp
|
||||
|
||||
@@ -11,3 +11,5 @@ contents
|
||||
hi
|
||||
./comsub-eof5.sub: line 13: warning: here-document at line 11 delimited by end-of-file (wanted `EOF')
|
||||
hi
|
||||
./comsub-eof6.sub: line 1: unexpected EOF while looking for matching `)'
|
||||
|
||||
|
||||
@@ -9,3 +9,5 @@ ${THIS_SH} ./comsub-eof3.sub
|
||||
${THIS_SH} ./comsub-eof4.sub
|
||||
|
||||
${THIS_SH} ./comsub-eof5.sub
|
||||
|
||||
${THIS_SH} ./comsub-eof6.sub
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
read foo <<EOF
|
||||
$(seq 10
|
||||
EOF
|
||||
|
||||
echo "$foo"
|
||||
+3
-1
@@ -117,6 +117,8 @@ searchable/.
|
||||
4:
|
||||
5: [qwe/
|
||||
6:
|
||||
a\*b
|
||||
a\*b*
|
||||
argv[1] = <a>
|
||||
argv[2] = <abc>
|
||||
argv[3] = <abd>
|
||||
@@ -131,7 +133,7 @@ argv[2] = <abc>
|
||||
argv[3] = <abd>
|
||||
argv[4] = <abe>
|
||||
tmp/l1 tmp/l2 tmp/*4 tmp/l3
|
||||
./glob.tests: line 63: no match: tmp/*4
|
||||
./glob.tests: line 64: no match: tmp/*4
|
||||
argv[1] = <bdir/>
|
||||
argv[1] = <*>
|
||||
argv[1] = <a*>
|
||||
|
||||
@@ -28,6 +28,7 @@ ${THIS_SH} ./glob4.sub
|
||||
${THIS_SH} ./glob5.sub
|
||||
${THIS_SH} ./glob6.sub
|
||||
${THIS_SH} ./glob7.sub
|
||||
${THIS_SH} ./glob8.sub
|
||||
|
||||
MYDIR=$PWD # save where we are
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# This program 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.
|
||||
#
|
||||
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
TESTDIR=${TMPDIR}/glob-test-$$
|
||||
mkdir ${TESTDIR}
|
||||
cd $TESTDIR || {
|
||||
echo "$TESTDIR: cannot cd" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
trap 'cd $OLDPWD && rm -rf $TESTDIR' EXIT
|
||||
|
||||
var='a\'
|
||||
touch 'a*b' 'a\*b'
|
||||
|
||||
printf '%s\n' $var\*b*
|
||||
|
||||
var1=a\\$'\001'
|
||||
printf '%s\n' $var1\*b*
|
||||
+2
-1
@@ -672,4 +672,5 @@ PASS;1 foo;2 foo;
|
||||
after: PASS
|
||||
argv[1] = </>
|
||||
argv[1] = </>
|
||||
./new-exp.tests: line 634: ABXD: parameter unset
|
||||
|
||||
./new-exp.tests: line 640: ABXD: parameter unset
|
||||
|
||||
@@ -626,6 +626,12 @@ a=/a
|
||||
recho "/${a%/*}"
|
||||
recho "/${a///a/}"
|
||||
|
||||
patfunc()
|
||||
{
|
||||
echo ${1##*"${1##*}"}
|
||||
}
|
||||
patfunc foo
|
||||
|
||||
# caused core dumps because of bad bracket expression parsing in bash-5.0
|
||||
eval : $'${x/#[0\xef\xbf\xbd\\Z[:]]}'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user