From b52af714453ae6a407161c4b8572e7ff8d53328c Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 17 Aug 2026 22:42:42 +0900 Subject: [PATCH] Fixed the check to determine whether mkmf.rb has already been loaded With a simple match for `/mkmf/`, any name might match if the source directory name contains `mkmf`. --- enc/make_encmake.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enc/make_encmake.rb b/enc/make_encmake.rb index a3d694a7b25648..2c075e38a6def5 100755 --- a/enc/make_encmake.rb +++ b/enc/make_encmake.rb @@ -6,7 +6,7 @@ # baseruby's cgi/escape.so and source cgi/escape.rb via erb. $:.unshift("#{dir}/lib") unless defined?(CROSS_COMPILING) $:.unshift(Dir.pwd, "#{dir}/tool/lib") -if $".grep(/mkmf/).empty? +unless $".any? {|feat| File.basename(feat) == "/mkmf.rb"} $" << "mkmf.rb" load File.expand_path("lib/mkmf.rb", dir) end