Skip to content

Commit

Permalink
sys-libs/readline: add upstream patch for excessive history memory al…
Browse files Browse the repository at this point in the history
…locs #597006
  • Loading branch information
vapier committed Nov 10, 2016
1 parent 2eedc08 commit 4b0bd0d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions sys-libs/readline/files/readline-7.0-history-alloclist.patch
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4b0bd0d

Please sign in to comment.