summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2016-11-16 12:57:31 -0500
committerChet Ramey <chet.ramey@case.edu>2016-11-16 12:57:31 -0500
commitacf3951d483e7b3478db4d731f4a8af99d27327d (patch)
treed7844672132f78fe89310ab9c010118312ca33cb
parentd49a9082c0e15bba8cd3d8cc0a994409cf823cac (diff)
downloadreadline-acf3951d483e7b3478db4d731f4a8af99d27327d.tar.gz
Readline-7.0 patch 1
-rw-r--r--history.c6
-rw-r--r--patchlevel2
2 files changed, 6 insertions, 2 deletions
diff --git a/history.c b/history.c
index 3b8dbc5..9ff25a7 100644
--- a/history.c
+++ b/history.c
@@ -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 *));
diff --git a/patchlevel b/patchlevel
index d8c9df7..fdf4740 100644
--- a/patchlevel
+++ b/patchlevel
@@ -1,3 +1,3 @@
# Do not edit -- exists only for use by patch
-0
+1