Skip to content

Commit

Permalink
fixed a bug of URI::extract. URI::extract should return ["mailto:xxx"…
Browse files Browse the repository at this point in the history
…] instead of ["mailtto:"] for "foo bar <mailto:xxx>".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@3131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
akira committed Dec 12, 2002
1 parent dd20cbb commit 817961e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/uri/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,19 @@ module PATTERN
X_ABS_URI = "
(#{PATTERN::SCHEME}): (?# 1: scheme)
(?:
(#{PATTERN::OPAQUE_PART}) (?# 2: opaque)
|
(?:(?:
//(?:
(?:(?:(#{PATTERN::USERINFO})@)? (?# 2: userinfo)
(?:(#{PATTERN::HOST})(?::(\\d*))?))?(?# 3: host, 4: port)
(?:(?:(#{PATTERN::USERINFO})@)? (?# 3: userinfo)
(?:(#{PATTERN::HOST})(?::(\\d*))?))?(?# 4: host, 5: port)
|
(#{PATTERN::REG_NAME}) (?# 5: registry)
(#{PATTERN::REG_NAME}) (?# 6: registry)
)
|
(?!//)) (?# XXX: '//' is the mark for hostport)
(#{PATTERN::ABS_PATH})? (?# 6: path)
)(?:\\?(#{PATTERN::QUERY}))? (?# 7: query)
|
(#{PATTERN::OPAQUE_PART}) (?# 8: opaque)
(#{PATTERN::ABS_PATH})? (?# 7: path)
)(?:\\?(#{PATTERN::QUERY}))? (?# 8: query)
)
(?:\\#(#{PATTERN::FRAGMENT}))? (?# 9: fragment)
"
Expand Down Expand Up @@ -292,8 +292,8 @@ def self.split(uri)
# null uri

when ABS_URI
scheme, userinfo, host, port,
registry, path, query, opaque, fragment = $~[1..-1]
scheme, opaque, userinfo, host, port,
registry, path, query, fragment = $~[1..-1]

# URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]

Expand Down

0 comments on commit 817961e

Please sign in to comment.