ruby-changes:55630
From: Nobuyoshi <ko1@a...>
Date: Tue, 30 Apr 2019 22:14:52 +0900 (JST)
Subject: [ruby-changes:55630] Nobuyoshi Nakada:df3de40932 (trunk): String#[] with index to extract matched substring safely
https://git.ruby-lang.org/ruby.git/commit/?id=df3de40932 From df3de409325d1e95d375a736d2bc9c45d47ec317 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Tue, 30 Apr 2019 22:13:47 +0900 Subject: String#[] with index to extract matched substring safely diff --git a/tool/merger.rb b/tool/merger.rb index 755e55c..025a559 100755 --- a/tool/merger.rb +++ b/tool/merger.rb @@ -316,7 +316,7 @@ else https://github.com/ruby/ruby/blob/trunk/tool/merger.rb#L316 end patch = resp.body - message = "\n\n#{(patch.match(/^Subject: (.*)\n\ndiff --git/m)&.[](1) || "Message not found for revision: #{git_rev}\n")}" + message = "\n\n#{(patch[/^Subject: (.*)\n\ndiff --git/m, 1] || "Message not found for revision: #{git_rev}\n")}" puts '+ git apply' IO.popen(['git', 'apply'], 'w') { |f| f.write(patch) } else -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/