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>
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
else if (vbuf) \
vbuf[0] = 0; \
terminate_immediately--; \
- fflush (stdout); \
+ if (ferror (stdout) == 0) \
+ fflush (stdout); \
if (ferror (stdout)) \
{ \
sh_wrerror (); \
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;
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);
if (ferror (stdout))
{
- sh_wrerror ();
- clearerr (stdout);
+ /* PRETURN will print error message. */
PRETURN (EXECUTION_FAILURE);
}
}
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
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
{
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++;
#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)
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)
./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
# 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
--- /dev/null
+. -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
./read3.sub: line 4: read: -1: invalid number
abc
ab
+abc
#
while read -u 3 var
do
echo $xyz
}
+echo abc | {
+ read -N 4 -d$'\n' foo
+ echo $foo
+}
+
read -n 1 < $0
echo "$REPLY"