]> git.ipfire.org Git - thirdparty/readline.git/commitdiff
Readline-7.0 patch 1
authorChet Ramey <chet.ramey@case.edu>
Wed, 16 Nov 2016 17:57:31 +0000 (12:57 -0500)
committerChet Ramey <chet.ramey@case.edu>
Wed, 16 Nov 2016 17:57:31 +0000 (12:57 -0500)
history.c
patchlevel

index 3b8dbc58651756f353ff10d34c54005146d6afe2..9ff25a71de7dbdc5ec2aaee5fa5e13ebb4fbe6b0 100644 (file)
--- 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 *));
index d8c9df7e6bb19b63a7c7f1c4f192a91529e40699..fdf474049fce8501d87e7b8fa7cf2b72cab0ad9b 100644 (file)
@@ -1,3 +1,3 @@
 # Do not edit -- exists only for use by patch
 
-0
+1