mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rdoc/parser.rb (RDoc.binary?): fix wrong regexp.
[ruby-core:44798] [Bug #6393] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c327407bdc
commit
8109c530b2
3 changed files with 9 additions and 1 deletions
|
@ -85,7 +85,7 @@ class RDoc::Parser
|
|||
if have_encoding then
|
||||
mode = "r"
|
||||
s.sub!(/\A#!.*\n/, '') # assume shebang line isn't longer than 1024.
|
||||
encoding = s[/^\s*\#\s*(?:-\*-\s*)?(?:en)?coding:\s*\([^\s;]+?\)(?:-\*-)?/, 1]
|
||||
encoding = s[/^\s*\#\s*(?:-\*-\s*)?(?:en)?coding:\s*([^\s;]+?)(?:-\*-|[\s;])/, 1]
|
||||
mode = "r:#{encoding}" if encoding
|
||||
s = File.open(file, mode) {|f| f.gets(nil, 1024)}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue