diff options
author | aycabta <aycabta@gmail.com> | 2020-05-03 14:36:33 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2020-05-17 19:26:53 +0900 |
commit | fc2a121c7c56ec29cddc426910aa1ac4cd3f5edc (patch) | |
tree | f0f04930a5e3c9adca5b62e3ef4ed264495a8628 /lib/reline | |
parent | dc0cdf4322aec0028e425f37104138afdb8e587c (diff) |
[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
Diffstat (limited to 'lib/reline')
-rw-r--r-- | lib/reline/config.rb | 6 |
1 files changed, 5 insertions, 1 deletions
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 |