mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-07 20:30:52 +02:00
fixed a bug with expanding unquoted $* when the separator is not whitespace and one or more of the positional parameters ends with the separator, resulting in an extra blank field being generated; fixed an issue with adjusting SHLVL in subshells that caused the environment to be rebuilt too many times; fix to make sure function substitution doesn't leave the -v option unset
This commit is contained in:
@@ -103,7 +103,7 @@ INC = -I. -I.. -I$(topdir) -I$(topdir)/lib -I$(topdir)/builtins -I${srcdir} \
|
||||
ALLPROG = print truefalse sleep finfo logname basename dirname fdflags \
|
||||
tty pathchk tee head mkdir rmdir mkfifo mktemp printenv id whoami \
|
||||
uname sync push ln unlink realpath strftime mypid setpgid seq rm \
|
||||
accept csv dsv cut stat getconf kv strptime chmod fltexpr jobid
|
||||
accept csv dsv cut stat getconf kv strptime chmod fltexpr jobid rev
|
||||
OTHERPROG = necho hello cat pushd asort
|
||||
|
||||
SUBDIRS = perl
|
||||
|
||||
@@ -364,7 +364,7 @@ cutline (SHELL_VAR *v, arrayind_t ind, char *line, struct cutop *ops)
|
||||
static int
|
||||
cutfile (SHELL_VAR *v, WORD_LIST *list, struct cutop *ops)
|
||||
{
|
||||
int fd, unbuffered_read, r;
|
||||
int fd, unbuffered_read, r, closefd;
|
||||
char *line, *b;
|
||||
size_t llen;
|
||||
WORD_LIST *l;
|
||||
@@ -378,11 +378,16 @@ cutfile (SHELL_VAR *v, WORD_LIST *list, struct cutop *ops)
|
||||
l = list;
|
||||
do
|
||||
{
|
||||
closefd = 0;
|
||||
|
||||
/* for each file */
|
||||
if (l == 0 || (l->word->word[0] == '-' && l->word->word[1] == '\0'))
|
||||
fd = 0;
|
||||
else
|
||||
fd = open (l->word->word, O_RDONLY);
|
||||
{
|
||||
fd = open (l->word->word, O_RDONLY);
|
||||
closefd = fd != -1;
|
||||
}
|
||||
if (fd < 0)
|
||||
{
|
||||
file_error (l->word->word);
|
||||
@@ -403,7 +408,8 @@ cutfile (SHELL_VAR *v, WORD_LIST *list, struct cutop *ops)
|
||||
r = cutline (v, ind, line, ops); /* can modify line */
|
||||
ind += r;
|
||||
}
|
||||
if (fd > 0)
|
||||
|
||||
if (closefd)
|
||||
close (fd);
|
||||
|
||||
QUIT;
|
||||
|
||||
Reference in New Issue
Block a user