diff options
author | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2019-07-30 12:44:38 +0900 |
---|---|---|
committer | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2019-07-30 12:44:38 +0900 |
commit | 2e6f777f9efa8ba15dcd1b7c1bb1917e5d31d6f8 (patch) | |
tree | 7170dab5f759de11460cb6c3fe1f1db0431d5adc | |
parent | 3805ef7fb57136be46fceb693340981c75eb8ec1 (diff) | |
download | ruby-2e6f777f9efa8ba15dcd1b7c1bb1917e5d31d6f8.tar.gz |
`/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/
```
-rw-r--r-- | lib/rdoc/servlet.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |