commit bash-20160923 snapshot

This commit is contained in:
Chet Ramey
2016-09-27 10:40:02 -04:00
parent f036615e27
commit 61c476d20d
27 changed files with 420 additions and 347 deletions
+2 -2
View File
@@ -390,10 +390,10 @@ xstrmatch (pattern, string, flags)
wchar_t *wpattern, *wstring;
size_t plen, slen, mplen, mslen;
if (mbsmbchar (string) == 0 && mbsmbchar (pattern) == 0)
if (MB_CUR_MAX == 1)
return (internal_strmatch ((unsigned char *)pattern, (unsigned char *)string, flags));
if (MB_CUR_MAX == 1)
if (mbsmbchar (string) == 0 && mbsmbchar (pattern) == 0)
return (internal_strmatch ((unsigned char *)pattern, (unsigned char *)string, flags));
n = xdupmbstowcs (&wpattern, NULL, pattern);
+5 -1
View File
@@ -57,6 +57,8 @@ extern int errno;
/* How big to make the_history when we first allocate it. */
#define DEFAULT_HISTORY_INITIAL_SIZE 502
#define MAX_HISTORY_INITIAL_SIZE 8192
/* The number of slots to increase the_history by. */
#define DEFAULT_HISTORY_GROW_SIZE 50
@@ -307,7 +309,9 @@ add_history (string)
if (history_size == 0)
{
if (history_stifled && history_max_entries > 0)
history_size = history_max_entries + 2;
history_size = (history_max_entries > MAX_HISTORY_INITIAL_SIZE)
? MAX_HISTORY_INITIAL_SIZE
: history_max_entries + 2;
else
history_size = DEFAULT_HISTORY_INITIAL_SIZE;
the_history = (HIST_ENTRY **)xmalloc (history_size * sizeof (HIST_ENTRY *));
+15
View File
@@ -49,6 +49,8 @@
#include "rlprivate.h"
#include "xmalloc.h"
#define MAX_MACRO_LEVEL 16
/* **************************************************************** */
/* */
/* Hacking Keyboard Macros */
@@ -83,12 +85,21 @@ struct saved_macro {
/* The list of saved macros. */
static struct saved_macro *macro_list = (struct saved_macro *)NULL;
static int macro_level = 0;
/* Set up to read subsequent input from STRING.
STRING is free ()'ed when we are done with it. */
void
_rl_with_macro_input (string)
char *string;
{
if (macro_level > MAX_MACRO_LEVEL)
{
_rl_errmsg ("maximum macro execution nesting level exceeded");
_rl_abort_internal ();
return;
}
_rl_push_executing_macro ();
rl_executing_macro = string;
executing_macro_index = 0;
@@ -146,6 +157,8 @@ _rl_push_executing_macro ()
saver->string = rl_executing_macro;
macro_list = saver;
macro_level++;
}
/* Discard the current macro, replacing it with the one
@@ -168,6 +181,8 @@ _rl_pop_executing_macro ()
xfree (macro);
}
macro_level--;
if (rl_executing_macro == 0)
RL_UNSETSTATE(RL_STATE_MACROINPUT);
}