mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-02 01:40:49 +02:00
commit bash-20150220 snapshot
This commit is contained in:
@@ -334,6 +334,8 @@ is_wcclass (wc, name)
|
||||
|
||||
memset (&state, '\0', sizeof (mbstate_t));
|
||||
mbs = (char *) malloc (wcslen(name) * MB_CUR_MAX + 1);
|
||||
if (mbs == 0)
|
||||
return -1;
|
||||
mbslength = wcsrtombs (mbs, (const wchar_t **)&name, (wcslen(name) * MB_CUR_MAX + 1), &state);
|
||||
|
||||
if (mbslength == (size_t)-1 || mbslength == (size_t)-2)
|
||||
|
||||
@@ -1307,6 +1307,8 @@ expanded value of @var{prompt}. Save the value of @var{lhandler} to
|
||||
use as a handler function to call when a complete line of input has been
|
||||
entered.
|
||||
The handler function receives the text of the line as an argument.
|
||||
As with @code{readline()}, the handler function should @code{free} the
|
||||
line when it it finished with it.
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun void rl_callback_read_char (void)
|
||||
@@ -1532,7 +1534,14 @@ resetting the terminal to its original state. If the application's signal
|
||||
handler does more than update its idea of the terminal size and return (for
|
||||
example, a @code{longjmp} back to a main processing loop), it @emph{must}
|
||||
call @code{rl_cleanup_after_signal()} (described below), to restore the
|
||||
terminal state.
|
||||
terminal state.
|
||||
|
||||
When an application is using the callback interface
|
||||
(@pxref{Alternate Interface}), Readline installs signal handlers only for
|
||||
the duration of the call to @code{rl_callback_read_char}. Applications
|
||||
using the callback interface should be prepared to clean up Readline's
|
||||
state if they wish to handle the signal before the line handler completes
|
||||
and restores the terminal state.
|
||||
|
||||
Readline provides two variables that allow application writers to
|
||||
control whether or not it will catch certain signals and act on them
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
@ignore
|
||||
Copyright (C) 1988-2014 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2015 Free Software Foundation, Inc.
|
||||
@end ignore
|
||||
|
||||
@set EDITION 6.3
|
||||
@set VERSION 6.3
|
||||
@set UPDATED 21 November 2014
|
||||
@set UPDATED-MONTH November 2014
|
||||
@set EDITION 6.4
|
||||
@set VERSION 6.4
|
||||
@set UPDATED 22 February 2015
|
||||
@set UPDATED-MONTH February 2015
|
||||
|
||||
@set LASTCHANGE Fri Nov 21 08:07:14 EST 2014
|
||||
@set LASTCHANGE Sun Feb 22 20:32:36 EST 2015
|
||||
|
||||
+4
-3
@@ -2,7 +2,7 @@
|
||||
* shmatch.c -- shell interface to posix regular expression matching.
|
||||
*/
|
||||
|
||||
/* Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2003-2015 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -79,7 +79,8 @@ sh_regmatch (string, pattern, flags)
|
||||
matches = NULL;
|
||||
#endif
|
||||
|
||||
if (regexec (®ex, string, regex.re_nsub + 1, matches, 0))
|
||||
/* man regexec: NULL PMATCH ignored if NMATCH == 0 */
|
||||
if (regexec (®ex, string, matches ? regex.re_nsub + 1 : 0, matches, 0))
|
||||
result = EXECUTION_FAILURE;
|
||||
else
|
||||
result = EXECUTION_SUCCESS; /* match */
|
||||
@@ -95,7 +96,7 @@ sh_regmatch (string, pattern, flags)
|
||||
rematch = make_new_array_variable ("BASH_REMATCH");
|
||||
amatch = array_cell (rematch);
|
||||
|
||||
if ((flags & SHMAT_SUBEXP) && result == EXECUTION_SUCCESS && subexp_str)
|
||||
if (matches && (flags & SHMAT_SUBEXP) && result == EXECUTION_SUCCESS && subexp_str)
|
||||
{
|
||||
for (subexp_ind = 0; subexp_ind <= regex.re_nsub; subexp_ind++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user