From fc2a121c7c56ec29cddc426910aa1ac4cd3f5edc Mon Sep 17 00:00:00 2001 From: aycabta Date: Sun, 3 May 2020 14:36:33 +0900 Subject: [ruby/reline] If history-size isn't numeric, it should be 500 https://tiswww.case.edu/php/chet/readline/readline.html#IDX25 > If an attempt is made to set history-size to a non-numeric value, the maximum > number of history entries will be set to 500. https://github.com/ruby/reline/commit/acf0437280 --- lib/reline/config.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/reline/config.rb b/lib/reline/config.rb index deca11f0ab..206be5be0e 100644 --- a/lib/reline/config.rb +++ b/lib/reline/config.rb @@ -210,7 +210,11 @@ class Reline::Config def bind_variable(name, value) case name when 'history-size' - @history_size = value.to_i + begin + @history_size = Integer(value) + rescue ArgumentError + @history_size = 500 + end when 'bell-style' @bell_style = case value -- cgit v1.2.3