From 2e6f777f9efa8ba15dcd1b7c1bb1917e5d31d6f8 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Tue, 30 Jul 2019 12:44:38 +0900 Subject: `/o` should not use with instance variable for example: ``` class C;def initialize(pat);@pat=pat;end;def re;/#{@pat}/o;end;end C.new('1').re #=> /1/ C.new('2').re #=> /1/ ``` --- lib/rdoc/servlet.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/rdoc/servlet.rb b/lib/rdoc/servlet.rb index 1fd9a62c12..e1d0f0ce82 100644 --- a/lib/rdoc/servlet.rb +++ b/lib/rdoc/servlet.rb @@ -112,7 +112,7 @@ class RDoc::Servlet < WEBrick::HTTPServlet::AbstractServlet # GET request entry point. Fills in +res+ for the path, etc. in +req+. def do_GET req, res - req.path.sub!(/\A#{Regexp.escape @mount_path}/o, '') if @mount_path + req.path.sub!(/\A#{Regexp.escape @mount_path}/, '') if @mount_path case req.path when '/' then -- cgit v1.2.3