[前][次][番号順一覧][スレッド一覧]

ruby-changes:66995

From: aycabta <ko1@a...>
Date: Fri, 30 Jul 2021 02:27:08 +0900 (JST)
Subject: [ruby-changes:66995] f1b5cb7e5d (master): [ruby/reline] Don't check the existence of Terminfo on Windows

https://git.ruby-lang.org/ruby.git/commit/?id=f1b5cb7e5d

From f1b5cb7e5d9498405f7ed611abda37cb0d9f2ea4 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Mon, 5 Jul 2021 15:54:12 +0900
Subject: [ruby/reline] Don't check the existence of Terminfo on Windows

https://github.com/ruby/reline/commit/320f09055c
---
 lib/reline/terminfo.rb | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lib/reline/terminfo.rb b/lib/reline/terminfo.rb
index 982fa3d..5234d02 100644
--- a/lib/reline/terminfo.rb
+++ b/lib/reline/terminfo.rb
@@ -6,6 +6,16 @@ module Reline::Terminfo https://github.com/ruby/ruby/blob/trunk/lib/reline/terminfo.rb#L6
 
   class TerminfoError < StandardError; end
 
+  def self.curses_dl_files
+    case RUBY_PLATFORM
+    when /mingw/, /mswin/
+      # aren't supported
+      []
+    else
+      %w[libncursesw.so libcursesw.so libncurses.so libcurses.so]
+    end
+  end
+
   @curses_dl = nil
   def self.curses_dl
     return @curses_dl if @curses_dl
@@ -24,7 +34,7 @@ module Reline::Terminfo https://github.com/ruby/ruby/blob/trunk/lib/reline/terminfo.rb#L34
       fiddle_supports_variadic = false
     end
     if fiddle_supports_variadic
-      %w[libncursesw.so libcursesw.so libncurses.so libcurses.so].each do |curses_name|
+      curses_dl_files.each do |curses_name|
         result = Fiddle::Handle.new(curses_name)
       rescue Fiddle::DLError
         next
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]