sys-libs/readline: add upstream patch for excessive history memory allocs #597006
authorMike Frysinger <vapier@gentoo.org>
Thu, 10 Nov 2016 06:01:14 +0000 (01:01 -0500)
committerMike Frysinger <vapier@gentoo.org>
Thu, 10 Nov 2016 06:01:14 +0000 (01:01 -0500)
sys-libs/readline/files/readline-7.0-history-alloclist.patch [new file with mode: 0644]
sys-libs/readline/readline-7.0-r1.ebuild [moved from sys-libs/readline/readline-7.0.ebuild with 98% similarity]

diff --git a/sys-libs/readline/files/readline-7.0-history-alloclist.patch b/sys-libs/readline/files/readline-7.0-history-alloclist.patch
new file mode 100644 (file)
index 0000000..73faa60
--- /dev/null
@@ -0,0 +1,29 @@
+https://bugs.gentoo.org/597006
+https://lists.gnu.org/archive/html/bug-bash/2016-10/msg00010.html
+
+*** ../bash-4.4/lib/readline/history.c 2015-12-28 13:50:31.000000000 -0500
+--- lib/readline/history.c     2016-09-30 14:28:40.000000000 -0400
+***************
+*** 58,61 ****
+--- 58,63 ----
+  #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
+***************
+*** 308,312 ****
+       {
+         if (history_stifled && history_max_entries > 0)
+!          history_size = history_max_entries + 2;
+         else
+           history_size = DEFAULT_HISTORY_INITIAL_SIZE;
+--- 310,316 ----
+       {
+         if (history_stifled && history_max_entries > 0)
+!          history_size = (history_max_entries > MAX_HISTORY_INITIAL_SIZE)
+!                              ? MAX_HISTORY_INITIAL_SIZE
+!                              : history_max_entries + 2;
+         else
+           history_size = DEFAULT_HISTORY_INITIAL_SIZE;
similarity index 98%
rename from sys-libs/readline/readline-7.0.ebuild
rename to sys-libs/readline/readline-7.0-r1.ebuild
index 56fddcb9593851d01dbf00bf3aac454c85c27c09..aecaa1cb43e4450a9f6de087d8f27e67a20850d1 100644 (file)
@@ -54,6 +54,7 @@ src_prepare() {
        epatch "${FILESDIR}"/${PN}-5.0-no_rpath.patch
        epatch "${FILESDIR}"/${PN}-6.2-rlfe-tgoto.patch #385091
        epatch "${FILESDIR}"/${PN}-7.0-headers.patch
+       epatch "${FILESDIR}"/${PN}-7.0-history-alloclist.patch #597006
 
        # Force ncurses linking. #71420
        # Use pkg-config to get the right values. #457558