commit bash-20110506 snapshot

This commit is contained in:
Chet Ramey
2011-12-29 13:07:43 -05:00
parent af5751ec16
commit bfd181e794
13 changed files with 99 additions and 17 deletions
+28
View File
@@ -11549,3 +11549,31 @@ lib/sh/eaccess.c
of the actual file permissions), so reorganize code to check the
file permissions as with eaccess. Report and fix from Johan Hattne
<johan.hattne@utsouthwestern.edu>
5/2
---
doc/{bash.1,bashref.texi}
- add forward reference to `Pattern Matching' from `Pathname
Expansion', suggested by Greg Wooledge <wooledg@eeg.ccf.org>
5/5
---
pcomplib.c
- the bash_completion project now distributes over 200 completions
for various programs, with no end in sight, so increase the value
of COMPLETE_HASH_BUCKETS from 32 to 128
pathexp.c
- quote_string_for_globbing: make sure CTLESC quoting CTLESC is
translated into \<CTLESC> even if the flags include QGLOB_REGEXP.
We don't want to process the second CTLESC as a quote character.
Fixes bug reported by Shawn Bohrer <sbohrer@rgmadvisors.com>
5/6
---
builtins/printf.def
- change PRETURN to not call fflush if ferror(stdout) is true
- if a call to one of the stdio functions or printstr leaves
ferror(stdout) true, and PRETURN is going to be called, let PRETURN
print the error message rather than doubling up the messages. Fixes
problem reported by Roman Rakus <rrakus@redhat.com>
+1
View File
@@ -845,6 +845,7 @@ tests/dstack2.tests f
tests/dstack2.right f
tests/errors.tests f
tests/errors.right f
tests/errors1.sub f
tests/execscript f
tests/exec.right f
tests/exec1.sub f 755
+13 -7
View File
@@ -158,7 +158,8 @@ extern int errno;
else if (vbuf) \
vbuf[0] = 0; \
terminate_immediately--; \
fflush (stdout); \
if (ferror (stdout) == 0) \
fflush (stdout); \
if (ferror (stdout)) \
{ \
sh_wrerror (); \
@@ -481,8 +482,11 @@ printf_builtin (list)
n = printstr (start, timebuf, strlen (timebuf), fieldwidth, precision); /* XXX - %s for now */
if (n < 0)
{
sh_wrerror ();
clearerr (stdout);
if (ferror (stdout) == 0)
{
sh_wrerror ();
clearerr (stdout);
}
PRETURN (EXECUTION_FAILURE);
}
break;
@@ -522,8 +526,11 @@ printf_builtin (list)
r = printstr (start, xp, rlen, fieldwidth, precision);
if (r < 0)
{
sh_wrerror ();
clearerr (stdout);
if (ferror (stdout) == 0)
{
sh_wrerror ();
clearerr (stdout);
}
retval = EXECUTION_FAILURE;
}
free (xp);
@@ -645,8 +652,7 @@ printf_builtin (list)
if (ferror (stdout))
{
sh_wrerror ();
clearerr (stdout);
/* PRETURN will print error message. */
PRETURN (EXECUTION_FAILURE);
}
}
+5 -1
View File
@@ -3124,7 +3124,11 @@ If one of these characters appears, then the word is
regarded as a
.IR pattern ,
and replaced with an alphabetically sorted list of
file names matching the pattern.
file names matching the pattern
(see
.SM
.B "Pattern Matching"
below).
If no matching file names are found,
and the shell option
.B nullglob
+2 -1
View File
@@ -2044,7 +2044,8 @@ After word splitting, unless the @option{-f} option has been set
If one of these characters appears, then the word is
regarded as a @var{pattern},
and replaced with an alphabetically sorted list of
file names matching the pattern. If no matching file names are found,
file names matching the pattern (@pxref{Pattern Matching}).
If no matching file names are found,
and the shell option @code{nullglob} is disabled, the word is left
unchanged.
If the @code{nullglob} option is set, and no matches are found, the word
+1 -1
View File
@@ -196,7 +196,7 @@ quote_string_for_globbing (pathname, qflags)
{
if ((qflags & QGLOB_FILENAME) && pathname[i+1] == '/')
continue;
if ((qflags & QGLOB_REGEXP) && ere_char (pathname[i+1]) == 0)
if (pathname[i+1] != CTLESC && (qflags & QGLOB_REGEXP) && ere_char (pathname[i+1]) == 0)
continue;
temp[j++] = '\\';
i++;
+1 -1
View File
@@ -37,7 +37,7 @@
#include "shell.h"
#include "pcomplete.h"
#define COMPLETE_HASH_BUCKETS 32 /* must be power of two */
#define COMPLETE_HASH_BUCKETS 128 /* must be power of two */
#define STRDUP(x) ((x) ? savestring (x) : (char *)NULL)
+3 -5
View File
@@ -96,13 +96,11 @@ do { \
sigprocmask (SIG_BLOCK, &nvar, &ovar); \
} while (0)
#define UNBLOCK_SIGNAL(ovar) sigprocmask (SIG_SETMASK, &ovar, (sigset_t)NULL)
#define UNBLOCK_SIGNAL(ovar) sigprocmask (SIG_SETMASK, &ovar, (sigset_t *) NULL)
#if defined (HAVE_POSIX_SIGNALS)
# define BLOCK_CHILD(nvar, ovar) \
BLOCK_SIGNAL (SIGCHLD, nvar, ovar)
# define UNBLOCK_CHILD(ovar) \
sigprocmask (SIG_SETMASK, &ovar, (sigset_t *) NULL)
# define BLOCK_CHILD(nvar, ovar) BLOCK_SIGNAL (SIGCHLD, nvar, ovar)
# define UNBLOCK_CHILD(ovar) UNBLOCK_SIGNAL(ovar)
#else /* !HAVE_POSIX_SIGNALS */
# define BLOCK_CHILD(nvar, ovar) ovar = sigblock (sigmask (SIGCHLD))
# define UNBLOCK_CHILD(ovar) sigsetmask (ovar)
+10 -1
View File
@@ -98,4 +98,13 @@ trap: usage: trap [-lp] [[arg] signal_spec ...]
./errors.tests: line 250: kill: `': not a pid or valid job spec
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
./errors.tests: line 255: set: trackall: invalid option name
./errors.tests: line 262: `!!': not a valid identifier
./errors1.sub: line 1: .: -i: invalid option
.: usage: . filename [arguments]
./errors1.sub: line 9: shift: -4: shift count out of range
./errors1.sub: line 5: return: -1: invalid option
return: usage: return [n]
./errors1.sub: line 14: break: -1: loop count out of range
./errors1.sub: line 20: return: -2: invalid option
return: usage: return [n]
after f
./errors.tests: line 264: `!!': not a valid identifier
+2
View File
@@ -254,6 +254,8 @@ kill -INT
# bad shell option names
set -o trackall # bash is not ksh
${THIS_SH} ./errors1.sub
# this must be last!
# in posix mode, a function name must be a valid identifier
# this can't go in posix2.tests, since it causes the shell to exit
+27
View File
@@ -0,0 +1,27 @@
. -i /dev/tty
f()
{
return -1
}
set -- a b c
shift -4
f
for f in 1 2 3; do
break -1
done
f()
{
return -25
}
f
echo after f
exit -25
exit -56
+1
View File
@@ -44,6 +44,7 @@ abcde
./read3.sub: line 4: read: -1: invalid number
abc
ab
abc
#
while read -u 3 var
do
+5
View File
@@ -15,5 +15,10 @@ echo ab | {
echo $xyz
}
echo abc | {
read -N 4 -d$'\n' foo
echo $foo
}
read -n 1 < $0
echo "$REPLY"