psss / rpms / bash

Forked from rpms/bash 6 years ago
Clone
1bf46ca
From 8ddc8d6e3a3d85eec6d4ba9b9ed2bc36bce56716 Mon Sep 17 00:00:00 2001
1bf46ca
From: Chet Ramey <chet.ramey@case.edu>
1bf46ca
Date: Mon, 14 Nov 2016 14:26:51 -0500
1bf46ca
Subject: [PATCH] Bash-4.4 patch 1
1bf46ca
1bf46ca
---
1bf46ca
 lib/readline/history.c | 6 +++++-
1bf46ca
 patchlevel.h           | 2 +-
1bf46ca
 2 files changed, 6 insertions(+), 2 deletions(-)
1bf46ca
1bf46ca
diff --git a/lib/readline/history.c b/lib/readline/history.c
1bf46ca
index 3b8dbc5..9ff25a7 100644
1bf46ca
--- a/lib/readline/history.c
1bf46ca
+++ b/lib/readline/history.c
1bf46ca
@@ -57,6 +57,8 @@ extern int errno;
1bf46ca
 /* How big to make the_history when we first allocate it. */
1bf46ca
 #define DEFAULT_HISTORY_INITIAL_SIZE	502
1bf46ca
 
1bf46ca
+#define MAX_HISTORY_INITIAL_SIZE	8192
1bf46ca
+
1bf46ca
 /* The number of slots to increase the_history by. */
1bf46ca
 #define DEFAULT_HISTORY_GROW_SIZE 50
1bf46ca
 
1bf46ca
@@ -307,7 +309,9 @@ add_history (string)
1bf46ca
       if (history_size == 0)
1bf46ca
 	{
1bf46ca
 	  if (history_stifled && history_max_entries > 0)
1bf46ca
-	    history_size = history_max_entries + 2;
1bf46ca
+	    history_size = (history_max_entries > MAX_HISTORY_INITIAL_SIZE)
1bf46ca
+				? MAX_HISTORY_INITIAL_SIZE
1bf46ca
+				: history_max_entries + 2;
1bf46ca
 	  else
1bf46ca
 	    history_size = DEFAULT_HISTORY_INITIAL_SIZE;
1bf46ca
 	  the_history = (HIST_ENTRY **)xmalloc (history_size * sizeof (HIST_ENTRY *));
1bf46ca
diff --git a/patchlevel.h b/patchlevel.h
1bf46ca
index 1cd7c96..40db1a3 100644
1bf46ca
--- a/patchlevel.h
1bf46ca
+++ b/patchlevel.h
1bf46ca
@@ -25,6 +25,6 @@
1bf46ca
    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
1bf46ca
    looks for to find the patch level (for the sccs version string). */
1bf46ca
 
1bf46ca
-#define PATCHLEVEL 0
1bf46ca
+#define PATCHLEVEL 1
1bf46ca
 
1bf46ca
 #endif /* _PATCHLEVEL_H_ */
1bf46ca
-- 
1bf46ca
2.9.3
1bf46ca