From f65f43d8aad008610187c5debbb8aac0cdc37fbe Mon Sep 17 00:00:00 2001 From: fenrir Date: Thu, 28 Aug 2025 10:06:14 +0900 Subject: [PATCH] Update RE to remove shell evaluation in case nested parentheses. --- lib/inline.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/inline.rb b/lib/inline.rb index 92840b2..922f55a 100644 --- a/lib/inline.rb +++ b/lib/inline.rb @@ -608,7 +608,7 @@ def build cmd = cmd.gsub(/-Wl,-soname,\$@/, "-Wl,-soname,#{File.basename so_name}") # strip off some makefile macros for mingw 1.9 - cmd = cmd.gsub(/\$\(.*\)/, '') if RUBY_PLATFORM =~ /mingw/ + cmd = cmd.gsub(/\$(?\((?:[^()]|\g)*\))/, '') if RUBY_PLATFORM =~ /mingw/ cmd += " 2> #{DEV_NULL}" if $TESTING and not $DEBUG