From b5e4d3569f8ee48164b9845801bbc4eb8f62171d Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sat, 27 Apr 2024 17:47:50 +0100 Subject: lineedit: reduce default history size Keep the maximum history size at 1023 but make the default 383. This gives a modest increase over the previous default of 255 while allowing users to increase or decrease the history size using the HISTFILESIZE environment variable. (GitHub issue #411) --- libbb/lineedit.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libbb/lineedit.c b/libbb/lineedit.c index ee494e013..1a095b657 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -1585,7 +1585,11 @@ line_input_t* FAST_FUNC new_line_input_t(int flags) unsigned FAST_FUNC size_from_HISTFILESIZE(const char *hp) { +# if ENABLE_PLATFORM_MINGW32 && MAX_HISTORY > 511 + int size = 384; +# else int size = MAX_HISTORY; +# endif if (hp) { size = atoi(hp); if (size <= 0) -- cgit v1.2.3-55-g6feb