1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix caching of curses_dl

This commit is contained in:
Nobuyoshi Nakada 2021-08-06 13:33:47 +09:00
parent 7af21a78fa
commit 9bfb8ea671
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -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