commit bash-snap-20170630 snapshot

This commit is contained in:
Chet Ramey
2017-06-30 15:16:39 -04:00
parent 68d220cb05
commit 9952f68c08
10 changed files with 64 additions and 16 deletions
+25
View File
@@ -14199,3 +14199,28 @@ expr.c
doc/{bash.1,bashref.texi}
- add text noting that $* and ${array[*]} (unquoted) can also expand
to multiple words
6/29
----
general.[ch]
- default_columns: new function, returns the value of COLUMNS, or
refreshes it if check_window_size is set and COLUMNS is unset. By
default, it returns 80
execute_cmd.c
- select_query: use default_columns() instead of fetching value of
COLUMNS directly
builtins/help.def
- show_builtin_command_help: use default_columns() instead of fetching
value of COLUMNS directly
6/30
----
builtins/read.def
- read_builtin: call QUIT during the read loop, just in case we get a
signal we should act on that didn't cause read to be interrupted.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1466737
- read_builtin: if -n or -N is supplied with a 0 argument, try a zero-
length read to detect errors and return failure if that read returns
a value < 0. Suggested by dualbus@gmail.com
+1 -4
View File
@@ -530,10 +530,7 @@ Use `man -k' or `info' to find out more about commands not in this list.\n\
A star (*) next to a name means that the command is disabled.\n\
\n"));
t = get_string_value ("COLUMNS");
width = (t && *t) ? atoi (t) : 80;
if (width <= 0)
width = 80;
width = default_columns ();
width /= 2;
if (width > sizeof (blurb))
+7 -3
View File
@@ -1,7 +1,7 @@
This file is read.def, from which is created read.c.
It implements the builtin "read" in Bash.
Copyright (C) 1987-2015 Free Software Foundation, Inc.
Copyright (C) 1987-2017 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -364,7 +364,11 @@ read_builtin (list)
/* More input and options validation */
if (nflag == 1 && nchars == 0)
goto assign_vars; /* bail early if asked to read 0 chars */
{
retval = read (fd, &c, 0);
retval = (retval >= 0) ? EXECUTION_SUCCESS : EXECUTION_FAILURE;
goto assign_vars; /* bail early if asked to read 0 chars */
}
/* $TMOUT, if set, is the default timeout for read. */
if (have_timeout == 0 && (e = get_string_value ("TMOUT")))
@@ -609,7 +613,7 @@ read_builtin (list)
}
CHECK_ALRM;
QUIT; /* in case we didn't call check_signals() */
#if defined (READLINE)
}
#endif
+2 -1
View File
@@ -119,7 +119,8 @@ If the
option is present, or if no arguments remain after option
processing, then commands are read from the standard input.
This option allows the positional parameters to be set
when invoking an interactive shell.
when invoking an interactive shell or when reading input
through a pipe.
.TP
.B \-D
A list of all double-quoted strings preceded by \fB$\fP
+2 -1
View File
@@ -6414,7 +6414,8 @@ Make the shell a restricted shell (@pxref{The Restricted Shell}).
If this option is present, or if no arguments remain after option
processing, then commands are read from the standard input.
This option allows the positional parameters to be set
when invoking an interactive shell.
when invoking an interactive shell or when reading input
through a pipe.
@item -D
A list of all double-quoted strings preceded by @samp{$}
+1 -6
View File
@@ -3185,12 +3185,7 @@ select_query (list, list_len, prompt, print_menu)
WORD_LIST *l;
char *repl_string, *t;
#if 0
t = get_string_value ("LINES");
LINES = (t && *t) ? atoi (t) : 24;
#endif
t = get_string_value ("COLUMNS");
COLS = (t && *t) ? atoi (t) : 80;
COLS = default_columns ();
#if 0
t = get_string_value ("TABSIZE");
+23
View File
@@ -1346,3 +1346,26 @@ conf_standard_path ()
# endif /* !CS_PATH */
#endif /* !_CS_PATH || !HAVE_CONFSTR */
}
int
default_columns ()
{
char *v;
int c;
c = -1;
v = get_string_value ("COLUMNS");
if (v && *v)
{
c = atoi (v);
if (c > 0)
return c;
}
if (check_window_size)
get_new_window_size (0, (int *)0, &c);
return (c > 0 ? c : 80);
}
+1
View File
@@ -335,5 +335,6 @@ extern char **get_group_list __P((int *));
extern int *get_group_array __P((int *));
extern char *conf_standard_path __P((void));
extern int default_columns __P((void));
#endif /* _GENERAL_H_ */
+1 -1
View File
@@ -1,6 +1,6 @@
/* zread - read data from file descriptor into buffer with retries */
/* Copyright (C) 1999-2002 Free Software Foundation, Inc.
/* Copyright (C) 1999-2017 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
+1
View File
@@ -119,6 +119,7 @@ extern char **subshell_envp;
extern int hup_on_exit;
extern int check_jobs_at_exit;
extern int autocd;
extern int check_window_size;
/* from version.c */
extern int build_version, patch_level;