Fix to replace only -e that is a path name in assert_crash_report

This commit is contained in:
Nobuyoshi Nakada 2023-09-29 17:43:14 +09:00
parent 5537a41059
commit 01c7656775
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465

View File

@ -861,7 +861,7 @@ class TestRubyOptions < Test::Unit::TestCase
FileUtils.mkpath(File.join(dir, File.dirname(cmd)))
File.write(File.join(dir, cmd), SEGVTest::KILL_SELF+"\n")
c = Regexp.quote(cmd)
list = list.map {|re| Regexp.new(re.source.gsub(/-e/) {c}, re.options)}
list = list.map {|re| Regexp.new(re.source.gsub(/^\s*(\(\?:)?\K-e(?=:)/) {c}, re.options)}
else
cmd = ['-e', SEGVTest::KILL_SELF]
end