mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-29 16:39:53 +02:00
commit bash-20190725 snapshot
This commit is contained in:
@@ -6375,3 +6375,18 @@ subst.c
|
||||
- match_upattern,match_wpattern: if the match length is greater than the
|
||||
string length, short-circuit and return failure. Fixes bug
|
||||
reported by Eduardo Bustamante <dualbus@gmail.com>
|
||||
|
||||
7/22
|
||||
----
|
||||
lib/glob/sm_loop.c
|
||||
- BRACKMATCH: if we think we've matched, tighten up the rules for
|
||||
the closing right bracket in the bracket expression to be correct
|
||||
in the presence of invalid character classes, collating symbols,
|
||||
and equivalence classes. If they're invalid, they shouldn't require
|
||||
additional right brackets to close them
|
||||
|
||||
7/25
|
||||
----
|
||||
builtins/colon.def
|
||||
- add the right includes so colon_builtin and false_builtin can take
|
||||
a WORD_LIST * argument like the prototype says they do
|
||||
|
||||
-6357
File diff suppressed because it is too large
Load Diff
Symlink
+1
@@ -0,0 +1 @@
|
||||
CWRU.chlog
|
||||
+6
-1
@@ -1,4 +1,4 @@
|
||||
# Makefile for bash-5.0, version 4.29
|
||||
# Makefile for bash-5.0, version 4.30
|
||||
#
|
||||
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
|
||||
|
||||
@@ -1467,6 +1467,10 @@ builtins/cd.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xma
|
||||
builtins/cd.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h
|
||||
builtins/cd.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
|
||||
builtins/cd.o: $(DEFSRC)/common.h quit.h pathnames.h
|
||||
builtins/colon.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h
|
||||
builtins/colon.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h
|
||||
builtins/colon.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
|
||||
builtins/colon.o: pathnames.h
|
||||
builtins/command.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h
|
||||
builtins/command.o: quit.h $(DEFSRC)/bashgetopt.h
|
||||
builtins/command.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h
|
||||
@@ -1479,6 +1483,7 @@ builtins/echo.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h x
|
||||
builtins/echo.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h
|
||||
builtins/echo.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
|
||||
builtins/echo.o: pathnames.h
|
||||
builtins/echo.o: $(DEFSRC)/common.h
|
||||
builtins/enable.o: command.h config.h ${BASHINCDIR}/memalloc.h error.h general.h xmalloc.h ${BASHINCDIR}/maxpath.h
|
||||
builtins/enable.o: shell.h syntax.h bashjmp.h ${BASHINCDIR}/posixjmp.h sig.h unwind_prot.h variables.h arrayfunc.h conftypes.h quit.h
|
||||
builtins/enable.o: dispose_cmd.h make_cmd.h subst.h externs.h ${BASHINCDIR}/stdc.h
|
||||
|
||||
@@ -410,6 +410,12 @@ cd.o: $(topdir)/make_cmd.h $(topdir)/subst.h $(topdir)/externs.h
|
||||
cd.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
cd.o: $(srcdir)/common.h $(BASHINCDIR)/maxpath.h ../pathnames.h
|
||||
cd.o: $(topdir)/sig.h
|
||||
colon.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h $(topdir)/error.h
|
||||
colon.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/subst.h $(topdir)/externs.h
|
||||
colon.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/sig.h
|
||||
colon.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
colon.o: $(BASHINCDIR)/maxpath.h ../pathnames.h
|
||||
colon.o: $(srcdir)/common.h
|
||||
command.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
command.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/externs.h
|
||||
command.o: $(topdir)/quit.h $(srcdir)/bashgetopt.h $(BASHINCDIR)/maxpath.h
|
||||
@@ -429,6 +435,7 @@ echo.o: $(topdir)/general.h $(topdir)/xmalloc.h $(topdir)/subst.h $(topdir)/exte
|
||||
echo.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/sig.h
|
||||
echo.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/unwind_prot.h $(topdir)/variables.h $(topdir)/conftypes.h
|
||||
echo.o: $(BASHINCDIR)/maxpath.h ../pathnames.h
|
||||
echo.o: $(srcdir)/common.h
|
||||
enable.o: $(topdir)/command.h ../config.h $(BASHINCDIR)/memalloc.h
|
||||
enable.o: $(topdir)/error.h $(topdir)/general.h $(topdir)/xmalloc.h
|
||||
enable.o: $(topdir)/quit.h $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h
|
||||
|
||||
+12
-3
@@ -1,7 +1,7 @@
|
||||
This file is colon.def, from which is created colon.c.
|
||||
It implements the builtin ":" in Bash.
|
||||
|
||||
Copyright (C) 1987-2009 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-2019 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -50,10 +50,19 @@ Exit Status:
|
||||
Always fails.
|
||||
$END
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#if defined (HAVE_UNISTD_H)
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "../bashansi.h"
|
||||
#include "../shell.h"
|
||||
|
||||
/* Return a successful result. */
|
||||
int
|
||||
colon_builtin (ignore)
|
||||
char *ignore;
|
||||
WORD_LIST *ignore;
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
@@ -61,7 +70,7 @@ colon_builtin (ignore)
|
||||
/* Return an unsuccessful result. */
|
||||
int
|
||||
false_builtin (ignore)
|
||||
char *ignore;
|
||||
WORD_LIST *ignore;
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
|
||||
+22
-10
@@ -384,9 +384,10 @@ BRACKMATCH (p, test, flags)
|
||||
{
|
||||
register CHAR cstart, cend, c;
|
||||
register int not; /* Nonzero if the sense of the character class is inverted. */
|
||||
int brcnt, brchr, forcecoll, isrange;
|
||||
int brcnt, forcecoll, isrange;
|
||||
INT pc;
|
||||
CHAR *savep;
|
||||
CHAR *brchrp;
|
||||
U_CHAR orig_test;
|
||||
|
||||
orig_test = test;
|
||||
@@ -597,7 +598,7 @@ matched:
|
||||
/* Skip the rest of the [...] that already matched. */
|
||||
c = *--p;
|
||||
brcnt = 1;
|
||||
brchr = 0;
|
||||
brchrp = 0;
|
||||
while (brcnt > 0)
|
||||
{
|
||||
int oc;
|
||||
@@ -611,15 +612,26 @@ matched:
|
||||
if (c == L('[') && (*p == L('=') || *p == L(':') || *p == L('.')))
|
||||
{
|
||||
brcnt++;
|
||||
brchr = *p;
|
||||
/* If brchr == ':' we need to check that the rest of the characters
|
||||
form a valid character class name. */
|
||||
brchrp = p++; /* skip over the char after the left bracket */
|
||||
if ((c = *p) == L('\0'))
|
||||
return ((test == L('[')) ? savep : (CHAR *)0);
|
||||
/* If *brchrp == ':' we should check that the rest of the characters
|
||||
form a valid character class name. We don't do that yet, but we
|
||||
keep BRCHRP in case we want to. */
|
||||
}
|
||||
/* we only want to check brchr if we set it above */
|
||||
else if (c == L(']') && brcnt > 1 && brchr != 0 && oc == brchr)
|
||||
brcnt--;
|
||||
else if (c == L(']') && brcnt == 1)
|
||||
brcnt--;
|
||||
/* We only want to check brchrp if we set it above. */
|
||||
else if (c == L(']') && brcnt > 1 && brchrp != 0 && oc == *brchrp)
|
||||
{
|
||||
brcnt--;
|
||||
brchrp = 0; /* just in case */
|
||||
}
|
||||
/* Left bracket loses its special meaning inside a bracket expression.
|
||||
It is only valid when followed by a `.', `=', or `:', which we check
|
||||
for above. Technically the right bracket can appear in a collating
|
||||
symbol, so we check for that here. Otherwise, it terminates the
|
||||
bracket expression. */
|
||||
else if (c == L(']') && (brchrp == 0 || *brchrp != L('.')) && brcnt >= 1)
|
||||
brcnt = 0;
|
||||
else if (!(flags & FNM_NOESCAPE) && c == L('\\'))
|
||||
{
|
||||
if (*p == '\0')
|
||||
|
||||
@@ -4803,7 +4803,7 @@ match_upattern (string, pat, mtype, sp, ep)
|
||||
end = string + len;
|
||||
|
||||
mlen = umatchlen (pat, len);
|
||||
if (mlen > len)
|
||||
if (mlen > (int)len)
|
||||
return (0);
|
||||
|
||||
switch (mtype)
|
||||
@@ -4960,7 +4960,7 @@ match_wpattern (wstring, indices, wstrlen, wpat, mtype, sp, ep)
|
||||
return (0);
|
||||
|
||||
mlen = wmatchlen (wpat, wstrlen);
|
||||
if (mlen > wstrlen)
|
||||
if (mlen > (int)wstrlen)
|
||||
return (0);
|
||||
|
||||
/* itrace("wmatchlen (%ls) -> %d", wpat, mlen); */
|
||||
|
||||
@@ -195,6 +195,8 @@ declare -A assoc=([0]="assoc" )
|
||||
assoc
|
||||
declare -A assoc=([two]="twoless" [three]="three" [one]="onemore" )
|
||||
declare -Ar assoc=([two]="twoless" [three]="three" [one]="onemore" )
|
||||
declare -A hash=([key]="value1" )
|
||||
declare -A hash=([key]="value1 value2" )
|
||||
declare -A b=([")"]="" ["\""]="" ["]"]="" ["\\"]="" ["\`"]="" )
|
||||
declare -A b=(["]"]="" ["\`"]="" )
|
||||
declare -A dict=(["'"]="3" ["\""]="1" ["\\"]="4" ["\`"]="2" )
|
||||
|
||||
@@ -213,6 +213,15 @@ declare -p assoc
|
||||
readonly -A assoc
|
||||
declare -p assoc
|
||||
|
||||
declare -A hash
|
||||
|
||||
hash=(["key"]="value1")
|
||||
declare -p hash
|
||||
hash=(["key"]="${hash["key"]} value2")
|
||||
declare -p hash
|
||||
|
||||
unset hash
|
||||
|
||||
${THIS_SH} ./assoc8.sub
|
||||
|
||||
# new shopt option to prevent multiple expansion of assoc array subscripts
|
||||
|
||||
+1
-1
@@ -672,4 +672,4 @@ PASS;1 foo;2 foo;
|
||||
after: PASS
|
||||
argv[1] = </>
|
||||
argv[1] = </>
|
||||
./new-exp.tests: line 618: ABXD: parameter unset
|
||||
./new-exp.tests: line 621: ABXD: parameter unset
|
||||
|
||||
@@ -613,6 +613,9 @@ a=/a
|
||||
recho "/${a%/*}"
|
||||
recho "/${a///a/}"
|
||||
|
||||
# caused core dumps because of bad bracket expression parsing in bash-5.0
|
||||
eval : $'${x/#[0\xef\xbf\xbd\\Z[:]]}'
|
||||
|
||||
# this must be last!
|
||||
expect $0: 'ABXD: parameter unset'
|
||||
recho ${ABXD:?"parameter unset"}
|
||||
|
||||
Reference in New Issue
Block a user