diff options
author | Ron Yorston <rmy@pobox.com> | 2024-04-27 17:47:50 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2024-04-27 17:47:50 +0100 |
commit | b5e4d3569f8ee48164b9845801bbc4eb8f62171d (patch) | |
tree | 292c876579fae6f60e2ab5cc256b783c1ca2f76c | |
parent | 31969e7058d746a722940ba2edee3556e74f23fb (diff) | |
download | busybox-w32-b5e4d3569f8ee48164b9845801bbc4eb8f62171d.tar.gz busybox-w32-b5e4d3569f8ee48164b9845801bbc4eb8f62171d.tar.bz2 busybox-w32-b5e4d3569f8ee48164b9845801bbc4eb8f62171d.zip |
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)
-rw-r--r-- | libbb/lineedit.c | 4 |
1 files changed, 4 insertions, 0 deletions
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) | |||
1585 | 1585 | ||
1586 | unsigned FAST_FUNC size_from_HISTFILESIZE(const char *hp) | 1586 | unsigned FAST_FUNC size_from_HISTFILESIZE(const char *hp) |
1587 | { | 1587 | { |
1588 | # if ENABLE_PLATFORM_MINGW32 && MAX_HISTORY > 511 | ||
1589 | int size = 384; | ||
1590 | # else | ||
1588 | int size = MAX_HISTORY; | 1591 | int size = MAX_HISTORY; |
1592 | # endif | ||
1589 | if (hp) { | 1593 | if (hp) { |
1590 | size = atoi(hp); | 1594 | size = atoi(hp); |
1591 | if (size <= 0) | 1595 | if (size <= 0) |