commit bash-20170707 snapshot

This commit is contained in:
Chet Ramey
2017-07-10 14:57:09 -04:00
parent 6364d76ebc
commit 68fd3b7615
7 changed files with 75 additions and 10 deletions
+32 -1
View File
@@ -1,4 +1,4 @@
' 2/14/2011
2/14/2011
---------
[bash-4.2 released]
@@ -14245,3 +14245,34 @@ lib/readline/complete.c
- fnprint: make sure print_len is initialized before using it on
systems without multibyte character support. Report and fix from
Juan Manuel Guerrero <juan.guerrero@gmx.de>
7/6
---
builtins/printf.def
- PRETURN,printf_builtin: check variable returned by bind_printf_variable,
return failure if that indicates we can't perform an assignment
because the variable is marked readonly or noassign. Fixes bug
reported by Arnaud Gaillard <arnaud.mgaillard@gmail.com>
7/7
---
lib/readline/text.c
- rl_quoted_insert: new feature: a negative argument means to insert
the next -COUNT characters using quoted-insert. Original feature
from Jason Hood <jadoxa@yahoo.com.au>. Still needs work on
redisplay
- _rl_insert_next_callback: implement support for negative arguments
similar to rl_quoted_insert: we just insert one at a time and keep
increasing the count until it hits 0
lib/readline/misc.c
- _rl_arg_callback: if the return value from _rl_arg_dispatch indicates
we should keep reading a numeric argument, update the message with
the new arg value
7/8
---
lib/readline/signals.c
- _rl_handle_signal: make sure all uses of any of the job control
signals are protected by a check for SIGTSTP being defined. Report
from Juan Manuel Guerrero <juan.guerrero@gmx.de>
+1 -1
View File
@@ -426,7 +426,7 @@ mkseq (start, end, incr, type, width)
result = strvec_mcreate (nelem + 1);
if (result == 0)
{
internal_error (_("brace expansion: failed to allocate memory for %d elements"), nelem);
internal_error (_("brace expansion: failed to allocate memory for %u elements"), (unsigned int)nelem);
return ((char **)NULL);
}
+8 -4
View File
@@ -1,7 +1,7 @@
This file is printf.def, from which is created printf.c.
It implements the builtin "printf" in Bash.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
Copyright (C) 1997-2017 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -148,8 +148,11 @@ extern int errno;
QUIT; \
if (vflag) \
{ \
bind_printf_variable (vname, vbuf, 0); \
SHELL_VAR *v; \
v = bind_printf_variable (vname, vbuf, 0); \
stupidly_hack_special_variables (vname); \
if (v == 0 || readonly_p (v) || noassign_p (v)) \
return (EXECUTION_FAILURE); \
} \
if (conv_bufsize > 4096 ) \
{ \
@@ -293,9 +296,10 @@ printf_builtin (list)
/* Allow printf -v var "" to act like var="" */
if (vflag && list->word->word && list->word->word[0] == '\0')
{
bind_printf_variable (vname, "", 0);
SHELL_VAR *v;
v = bind_printf_variable (vname, "", 0);
stupidly_hack_special_variables (vname);
return (EXECUTION_SUCCESS);
return ((v == 0 || readonly_p (v) || noassign_p (v)) ? EXECUTION_FAILURE : EXECUTION_SUCCESS);
}
if (list->word->word == 0 || list->word->word[0] == '\0')
+2
View File
@@ -275,6 +275,8 @@ _rl_arg_callback (_rl_arg_cxt cxt)
}
r = _rl_arg_dispatch (cxt, c);
if (r > 0)
rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg);
return (r != 1);
}
+2
View File
@@ -249,9 +249,11 @@ _rl_handle_signal (int sig)
rl_cleanup_after_signal ();
#if defined (HAVE_POSIX_SIGNALS)
# if defined (SIGTSTP)
/* Unblock SIGTTOU blocked above */
if (sig == SIGTTIN || sig == SIGTSTP)
sigprocmask (SIG_UNBLOCK, &set, (sigset_t *)NULL);
# endif
sigemptyset (&set);
sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &set);
+29 -3
View File
@@ -980,14 +980,29 @@ _rl_insert_next (int count)
static int
_rl_insert_next_callback (_rl_callback_generic_arg *data)
{
int count;
int count, r;
count = data->count;
r = 0;
if (count < 0)
{
data->count++;
r = _rl_insert_next (1);
_rl_want_redisplay = 1;
/* If we should keep going, leave the callback function installed */
if (data->count < 0 && r == 0)
return r;
count = 0; /* data->count == 0 || r != 0; force break below */
}
/* Deregister function, let rl_callback_read_char deallocate data */
_rl_callback_func = 0;
_rl_want_redisplay = 1;
if (count == 0)
return r;
return _rl_insert_next (count);
}
#endif
@@ -1009,7 +1024,18 @@ rl_quoted_insert (int count, int key)
return (0);
}
#endif
/* A negative count means to quote the next -COUNT characters. */
if (count < 0)
{
int r;
do
r = _rl_insert_next (1);
while (r == 0 && ++count < 0);
return r;
}
return _rl_insert_next (count);
}
+1 -1
View File
@@ -578,7 +578,7 @@ main (argc, argv, env)
*/
if (interactive_shell)
{
char *term, *emacs, *inside_emacs;;
char *term, *emacs, *inside_emacs;
int emacs_term, in_emacs;
term = get_string_value ("TERM");