8ed5187
From acf3951d483e7b3478db4d731f4a8af99d27327d Mon Sep 17 00:00:00 2001
8ed5187
From: Chet Ramey <chet.ramey@case.edu>
8ed5187
Date: Wed, 16 Nov 2016 12:57:31 -0500
8ed5187
Subject: [PATCH] Readline-7.0 patch 1
8ed5187
8ed5187
---
8ed5187
 history.c  | 6 +++++-
8ed5187
 patchlevel | 2 +-
8ed5187
 2 files changed, 6 insertions(+), 2 deletions(-)
8ed5187
8ed5187
diff --git a/history.c b/history.c
8ed5187
index 3b8dbc5..9ff25a7 100644
8ed5187
--- a/history.c
8ed5187
+++ b/history.c
8ed5187
@@ -57,6 +57,8 @@ extern int errno;
8ed5187
 /* How big to make the_history when we first allocate it. */
8ed5187
 #define DEFAULT_HISTORY_INITIAL_SIZE	502
8ed5187
 
8ed5187
+#define MAX_HISTORY_INITIAL_SIZE	8192
8ed5187
+
8ed5187
 /* The number of slots to increase the_history by. */
8ed5187
 #define DEFAULT_HISTORY_GROW_SIZE 50
8ed5187
 
8ed5187
@@ -307,7 +309,9 @@ add_history (string)
8ed5187
       if (history_size == 0)
8ed5187
 	{
8ed5187
 	  if (history_stifled && history_max_entries > 0)
8ed5187
-	    history_size = history_max_entries + 2;
8ed5187
+	    history_size = (history_max_entries > MAX_HISTORY_INITIAL_SIZE)
8ed5187
+				? MAX_HISTORY_INITIAL_SIZE
8ed5187
+				: history_max_entries + 2;
8ed5187
 	  else
8ed5187
 	    history_size = DEFAULT_HISTORY_INITIAL_SIZE;
8ed5187
 	  the_history = (HIST_ENTRY **)xmalloc (history_size * sizeof (HIST_ENTRY *));
8ed5187
diff --git a/patchlevel b/patchlevel
8ed5187
index d8c9df7..fdf4740 100644
8ed5187
--- a/patchlevel
8ed5187
+++ b/patchlevel
8ed5187
@@ -1,3 +1,3 @@
8ed5187
 # Do not edit -- exists only for use by patch
8ed5187
 
8ed5187
-0
8ed5187
+1
8ed5187
-- 
8ed5187
2.9.3
8ed5187