commit bash-20180427 snapshot

This commit is contained in:
Chet Ramey
2018-04-30 09:45:04 -04:00
parent fd01c588ad
commit 2afeb2af6a
101 changed files with 17433 additions and 13694 deletions
+50 -1
View File
@@ -14019,7 +14019,7 @@ variables.c
- make_env_array_from_var_list: if a dynamic variable has the
regenerate attribute set, call the dynamic value function to generate
an updated value before placing it in the environment. From a report
about exporting LINENO from by Robert Elz <kre@bmunnari.OZ.AU>
about exporting LINENO from Robert Elz <kre@bmunnari.OZ.AU>
6/4
---
@@ -15269,3 +15269,52 @@ execute_cmd.c
when trying to open a FIFO with no process having it open for
reading
4/26
----
parse.y
- read_token_word: if returning REDIR_WORD for a {id}>foo construct,
for example, make sure to assign the_word to yylval.word before
returning, in case a recursive call to the parser overwrites it
(e.g., when evaluating array indexes). From a message to
austin-group-l from Stephane Chazelas <stephane.chazelas@gmail.com>
lib/glob/sm_loop.c
- BRACKMATCH: if we have an invalid character class in an otherwise
well-formed bracket expression, don't try to match each character
of the (invalid) class individually; just skip over the class and
move on. From a message on the austin-group list from
Stephane Chazelas <stephane.chazelas@gmail.com>
4/27
----
variables.c
- push_exported_var,push_func_var,push_temp_var: make sure to set the
context correctly in the variable we bind in the previous (non-temp)
scope. Report from Martijn Dekker <martijn@inlv.org>
pathexp.c
- unquoted_glob_pattern_p: a pattern that contains a backslash can
have it removed by the matching engine (since backslash is special
in pattern matching), so if the pattern contains a backslash, and
does not end in a backslash, we need to return true. Fixes bug
reported by Robert Elz <kre@bmunnari.OZ.AU>
lib/glob/gm_loop.c
- INTERNAL_GLOB_PATTERN_P: same change to return TRUE for a backslash
that doesn't end the pattern
lib/sh/timeval.c
- print_timeval: use locale_decpoint() instead of fixed `.' to print
decimal point. Bug report in austin-group email from Joerg Schilling
<Joerg.Schilling@fokus.fraunhofer.de>
lib/sh/clock.c
- print_clock_t: use locale_depoint() in the same way as print_timeval
4/29
----
subst.c
- expand_cond_node: if special != 0, make sure to add QGLOB_CTLESC
to the flags passed to quote_string_for_globbing. Same issue as the
one with `case' fixed on 4/7, report from Martijn Dekker
<martijn@inlv.org>
+4
View File
@@ -537,6 +537,8 @@ po/nb.gmo f
po/nl.po f
po/pl.gmo f
po/pl.po f
po/pt.gmo f
po/pt.po f
po/pt_BR.gmo f
po/pt_BR.po f
po/ro.gmo f
@@ -1050,6 +1052,7 @@ tests/getopts10.sub f
tests/glob.tests f
tests/glob1.sub f
tests/glob2.sub f
tests/glob3.sub f
tests/glob.right f
tests/globstar.tests f
tests/globstar.right f
@@ -1360,6 +1363,7 @@ tests/varenv8.sub f
tests/varenv9.sub f
tests/varenv10.sub f
tests/varenv11.sub f
tests/varenv12.sub f
tests/version f
tests/version.mini f
tests/vredir.tests f
+1 -1
View File
@@ -8411,7 +8411,7 @@ compiled and linked, rather than changing run-time features.
@table @code
@item --enable-largefile
Enable support for @uref{http://www.sas.com/standards/large_file/x_open.20Mar96.html,
Enable support for @uref{http://www.unix.org/version2/whatsnew/lfs20mar.html,
large files} if the operating system requires special compiler options
to build programs which can access large files. This is enabled by
default, if the operating system provides large file support.
+10
View File
@@ -776,6 +776,7 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
return (last_command_exit_value = EXECUTION_FAILURE);
}
#if 0
if (redirection_undo_list)
{
/* XXX - why copy here? */
@@ -784,7 +785,12 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
}
else
my_undo_list = (REDIRECT *)NULL;
#else
my_undo_list = redirection_undo_list;
redirection_undo_list = (REDIRECT *)NULL;
#endif
#if 0
if (exec_redirection_undo_list)
{
/* XXX - why copy here? */
@@ -793,6 +799,10 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
}
else
exec_undo_list = (REDIRECT *)NULL;
#else
exec_undo_list = exec_redirection_undo_list;
exec_redirection_undo_list = (REDIRECT *)NULL;
#endif
if (my_undo_list || exec_undo_list)
begin_unwind_frame ("loop_redirections");
+13 -1
View File
@@ -92,15 +92,27 @@ extern char *strcpy __P((char *, const char *));
/* Nonzero if the integer type T is signed. */
#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
/* The width in bits of the integer type or expression T.
Padding bits are not supported; this is checked at compile-time below. */
#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
/* Bound on length of the string representing an unsigned integer
value representable in B bits. log10 (2.0) < 146/485. The
smallest value of B where this bound is not tight is 2621. */
#define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485)
/* Bound on length of the string representing an integer value of type T.
Subtract one for the sign bit if T is signed;
302 / 1000 is log10 (2) rounded up;
add one for integer division truncation;
add one more for a minus sign if t is signed. */
#define INT_STRLEN_BOUND(t) \
((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 1000 \
((TYPE_WIDTH (t) - TYPE_SIGNED (t)) * 302 / 1000 \
+ 1 + TYPE_SIGNED (t))
/* Bound on buffer size needed to represent an integer type or expression T,
including the terminating null. */
#define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1)
/* Define exactly what a legal shell identifier consists of. */
#define legal_variable_starter(c) (ISALPHA(c) || (c == '_'))
+5 -2
View File
@@ -54,8 +54,11 @@ INTERNAL_GLOB_PATTERN_P (pattern)
continue;
case L('\\'):
if (*p++ == L('\0'))
return 0;
/* Don't let the pattern end in a backslash (GMATCH returns no match
if the pattern ends in a backslash anyway), but otherwise return 1,
since the matching engine uses backslash as an escape character
and it can be removed. */
return (*p != L('\0'));
}
return 0;
+12 -1
View File
@@ -458,7 +458,18 @@ BRACKMATCH (p, test, flags)
pc = IS_CCLASS (orig_test, (XCHAR *)ccname);
}
if (pc == -1)
pc = 0;
{
/* CCNAME is not a valid character class in the current
locale. In addition to noting no match (pc = 0), we have
a choice about what to do with the invalid charclass.
Posix leaves the behavior unspecified, but we're going
to skip over the charclass and keep going instead of
testing ORIG_TEST against each character in the class
string. If we don't want to do that, take out the update
of P. */
pc = 0;
p = close + 2;
}
else
p = close + 2; /* move past the closing `]' */
+8 -2
View File
@@ -32,7 +32,13 @@
#include <stdio.h>
#include <stdc.h>
extern long get_clk_tck __P((void));
#include <bashintl.h>
#ifndef locale_decpoint
extern int locale_decpoint PARAMS((void));
#endif
extern long get_clk_tck PARAMS((void));
void
clock_t_to_secs (t, sp, sfp)
@@ -76,6 +82,6 @@ print_clock_t (fp, t)
minutes = timestamp / 60;
seconds = timestamp % 60;
fprintf (fp, "%ldm%d.%03ds", minutes, seconds, seconds_fraction);
fprintf (fp, "%ldm%d%c%03ds", minutes, seconds, locale_decpoint(), seconds_fraction);
}
#endif /* HAVE_TIMES */
+8 -1
View File
@@ -25,6 +25,13 @@
#include <sys/types.h>
#include <posixtime.h>
#include <bashintl.h>
#include <stdc.h>
#ifndef locale_decpoint
extern int locale_decpoint PARAMS((void));
#endif
#include <stdio.h>
struct timeval *
@@ -140,6 +147,6 @@ print_timeval (fp, tvp)
minutes = timestamp / 60;
seconds = timestamp % 60;
fprintf (fp, "%ldm%d.%03ds", minutes, seconds, seconds_fraction);
fprintf (fp, "%ldm%d%c%03ds", minutes, seconds, locale_decpoint (), seconds_fraction);
}
#endif /* HAVE_TIMEVAL */
+3 -1
View File
@@ -5295,6 +5295,7 @@ got_token:
yylval.word = the_word;
/* should we check that quoted == 0 as well? */
if (token[0] == '{' && token[token_index-1] == '}' &&
(character == '<' || character == '>'))
{
@@ -5307,7 +5308,8 @@ got_token:
#endif
{
strcpy (the_word->word, token+1);
/*itrace("read_token_word: returning REDIR_WORD for %s", the_word->word);*/
/* itrace("read_token_word: returning REDIR_WORD for %s", the_word->word); */
yylval.word = the_word; /* accommodate recursive call */
return (REDIR_WORD);
}
else
+11 -5
View File
@@ -96,8 +96,13 @@ unquoted_glob_pattern_p (string)
return (1);
continue;
case CTLESC:
/* A pattern can't end with a backslash, but a backslash in the pattern
can be removed by the matching engine, so we have to run it through
globbing. */
case '\\':
return (*string != 0);
case CTLESC:
if (*string++ == '\0')
return (0);
}
@@ -172,10 +177,11 @@ glob_char_p (s)
is performed, (flags & QGLOB_CVTNULL) should be 0; if called when quote
removal has not been done (for example, before attempting to match a
pattern while executing a case statement), flags should include
QGLOB_CVTNULL. If flags includes QGLOB_FILENAME, appropriate quoting
to match a filename should be performed. QGLOB_REGEXP means we're
quoting for a Posix ERE (for [[ string =~ pat ]]) and that requires
some special handling. */
QGLOB_CVTNULL. If flags includes QGLOB_CTLESC, we need to remove CTLESC
quoting CTLESC or CTLNUL (as if dequote_string were called). If flags
includes QGLOB_FILENAME, appropriate quoting to match a filename should be
performed. QGLOB_REGEXP means we're quoting for a Posix ERE (for
[[ string =~ pat ]]) and that requires some special handling. */
char *
quote_string_for_globbing (pathname, qflags)
const char *pathname;
+1 -1
View File
@@ -1,2 +1,2 @@
# Set of available languages.
en@quot en@boldquot af bg ca cs da de el eo es et fi fr ga gl hr hu id it ja lt nb nl pl pt_BR ro ru sk sl sr sv tr uk vi zh_CN zh_TW
en@quot en@boldquot af bg ca cs da de el eo es et fi fr ga gl hr hu id it ja lt nb nl pl pt pt_BR ro ru sk sl sr sv tr uk vi zh_CN zh_TW
BIN
View File
Binary file not shown.
+271 -282
View File
File diff suppressed because it is too large Load Diff
+207 -203
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+210 -203
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+909 -947
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+210 -203
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+225 -230
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+297 -266
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+621 -360
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.
+231 -232
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+389 -434
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+210 -203
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+1003 -3929
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+214 -223
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+231 -249
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+210 -203
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+712 -462
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+225 -240
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+212 -215
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+210 -203
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+211 -209
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+225 -230
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+208 -203
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+229 -248
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+215 -208
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+210 -203
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+210 -203
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+5871
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+212 -205
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+256 -269
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+269 -274
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+225 -230
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+233 -235
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+210 -203
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+210 -203
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+469 -439
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+210 -203
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+211 -203
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+210 -203
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+211 -209
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1475,7 +1475,7 @@ cprintf (control, va_alist)
#endif
{
register const char *s;
char char_arg[2], *argp, intbuf[INT_STRLEN_BOUND (int) + 1];
char char_arg[2], *argp, intbuf[INT_STRLEN_BOUND (unsigned int) + 1];
int digit_arg, arg_len, c;
va_list args;
@@ -1520,7 +1520,7 @@ cprintf (control, va_alist)
digit_arg = va_arg (args, int);
if (digit_arg < 0)
{
sprintf (intbuf, "%u", (unsigned)-1);
sprintf (intbuf, "%u", (unsigned int)-1);
argp = intbuf;
}
else
+1 -1
View File
@@ -3632,7 +3632,7 @@ cond_expand_word (w, special)
/* Need to figure out whether or not we should call dequote_escapes
or a new dequote_ctlnul function here, and under what
circumstances. */
qflags = QGLOB_CVTNULL;
qflags = QGLOB_CVTNULL|QGLOB_CTLESC;
if (special == 2)
qflags |= QGLOB_REGEXP;
word_list_remove_quoted_nulls (l);
+1 -1
View File
@@ -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
+3
View File
@@ -35,3 +35,6 @@ for c in $'\1' $'\2' $'\177'; do
testmatch "x${c}" "\\x\\${c}"
testmatch "x${c}" "x\\${c}"
done
match() { case $1 in ( $2 ) ;; ( * ) return 1 ;; esac; }
match $'? *x\1y\177z' $'??\\*\\x\\\1\\y\\\177\\z' || echo bad 6
+3
View File
@@ -180,6 +180,9 @@ echo ${BASH_REMATCH[@]}
if [[ "123abc" == *?(a)bc ]]; then echo ok 42; else echo bad 42; fi
if [[ "123abc" == *?(a)bc ]]; then echo ok 43; else echo bad 43; fi
match() { [[ $1 == $2 ]]; }
match $'? *x\1y\177z' $'??\\*\\x\\\1\\y\\\177\\z' || echo bad 44
foo=""
[[ bar == *"${foo,,}"* ]] && echo ok 1
[[ bar == *${foo,,}* ]] && echo ok 2
+44 -1
View File
@@ -13,6 +13,49 @@ argv[1] = <a
0000004
ok 6
ok 7
invalid bracket expression
== LANG=C ==
[[:alpha:]
ok 1
[a
[[:alpha:]
ok 2
ok 3
== LANG=en_US.UTF-8 ==
[[:alpha:]
ok 1
[a
[[:alpha:]
ok 2
ok 3
invalid character class
== LANG=C ==
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
== LANG=en_US.UTF-8 ==
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
invalid collating symbols
== LANG=C ==
ok 1
ok 2
ok 3
ok 4
ok 5
== LANG=en_US.UTF-8 ==
ok 1
ok 2
ok 3
ok 4
ok 5
argv[1] = <a>
argv[2] = <abc>
argv[3] = <abd>
@@ -27,7 +70,7 @@ argv[2] = <abc>
argv[3] = <abd>
argv[4] = <abe>
tmp/l1 tmp/l2 tmp/*4 tmp/l3
./glob.tests: line 45: no match: tmp/*4
./glob.tests: line 46: no match: tmp/*4
argv[1] = <bdir/>
argv[1] = <*>
argv[1] = <a*>
+1
View File
@@ -10,6 +10,7 @@ expect()
# First, a test that bash-2.01.1 fails
${THIS_SH} ./glob1.sub
${THIS_SH} ./glob2.sub
${THIS_SH} ./glob3.sub
MYDIR=$PWD # save where we are
+123
View File
@@ -0,0 +1,123 @@
: ${TMPDIR:=/var/tmp}
cd $TMPDIR
matchfunc()
{
echo == LANG=$LANG ==
touch a p
echo [[:alpha:]
rm a p
case l in
[[:alpha:]) echo bad 1;;
*) echo ok 1;;
esac
touch '[a' '[x'
echo [[:alpha:]
rm '[a'
echo [[:alpha:]
rm '[x'
case [a in
[[:alpha:]) echo ok 2;;
*) echo bad 2;;
esac
case [x in
[[:alpha:]) echo bad 3;;
*) echo ok 3;;
esac
}
echo invalid bracket expression
export LANG=C
matchfunc
export LANG=en_US.UTF-8
matchfunc
unset -f matchfunc
matchfunc()
{
echo == LANG=$LANG ==
case a] in
[[:aleph:]]) echo bad 1;;
*) echo ok 1;;
esac
case a in
[[:aleph:]]) echo bad 2;;
*) echo ok 2;;
esac
case a] in
[[:"alpha":]]) echo bad 3;;
*) echo ok 3;;
esac
case a in
[[:"alpha":]]) echo bad 4;;
*) echo ok 4;;
esac
case a in
[abc[:foo:]]) echo ok 5;;
*) echo bad 5 ;;
esac
case a in
[[:foo:]abc]) echo ok 6;;
*) echo bad 6 ;;
esac
}
echo invalid character class
export LANG=C
matchfunc
export LANG=en_US.UTF-8
matchfunc
unset -f matchfunc
matchfunc()
{
echo == LANG=$LANG ==
case h in
[[.hyphen.]) echo bad 1;;
*) echo ok 1;;
esac
case - in
[[.hyphen.]]) echo ok 2;;
*) echo bad 2;;
esac
case slash in
[[.slash.]]) echo bad 3;;
*) echo ok 3;;
esac
case a in
[abc[.nonsense.]]) echo ok 4;;
*) echo bad 4 ;;
esac
case a in
[[.nonsense.]abc]) echo ok 5;;
*) echo bad 5 ;;
esac
}
echo invalid collating symbols
export LANG=C
matchfunc
export LANG=en_US.UTF-8
matchfunc
+4 -3
View File
@@ -20,13 +20,15 @@ case 9 in
[![:alpha:]]) echo ok 4;;
esac
# invalid character class expressions are just characters to be matched
case a in
[:al:]) echo ok 5;;
esac
# invalid character class expressions are no longer just characters to be
# matched
case a in
[[:al:]) echo ok 6;;
[[:al:]) echo bad 6;;
*) echo ok 6;;
esac
case '!' in
@@ -230,4 +232,3 @@ case a in
[[=b=]) echo oops;; # an incomplete equiv class is just a string
*) echo ok 3;;
esac
+3
View File
@@ -231,5 +231,8 @@ ${THIS_SH} ./varenv10.sub
# tests of compound assignments in function scope
${THIS_SH} ./varenv11.sub
# temporary environment variable propagation in posix mode
${THIS_SH} ./varenv12.sub
# make sure variable scoping is done right
tt() { typeset a=b;echo a=$a; };a=z;echo a=$a;tt;echo a=$a
+4
View File
@@ -0,0 +1,4 @@
set -o posix
fn() { foo=abc : ; typeset +x foo; printenv|grep ^foo=; }
fn

Some files were not shown because too many files have changed in this diff Show More