From 9bfb8ea6715571b4318b018b703d40750acf2ccb Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 6 Aug 2021 13:33:47 +0900 Subject: [PATCH] Fix caching of curses_dl --- lib/reline/terminfo.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/reline/terminfo.rb b/lib/reline/terminfo.rb index 79f3f1de8e..a2dae4479c 100644 --- a/lib/reline/terminfo.rb +++ b/lib/reline/terminfo.rb @@ -20,9 +20,9 @@ module Reline::Terminfo end end - @curses_dl = nil + @curses_dl = false def self.curses_dl - return @curses_dl if @curses_dl + return @curses_dl unless @curses_dl == false if RUBY_VERSION >= '3.0.0' # Gem module isn't defined in test-all of the Ruby repository, and # Fiddle in Ruby 3.0.0 or later supports Fiddle::TYPE_VARIADIC. @@ -47,6 +47,7 @@ module Reline::Terminfo break end end + @curses_dl = nil if @curses_dl == false @curses_dl end end