mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/resolv.rb: don't use Regexp#source to embed regexps.
[ruby-dev:23432] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
47852967cd
commit
19d9c8d0c2
2 changed files with 17 additions and 11 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Apr 23 14:14:38 2004 Tanaka Akira <akr@m17n.org>
|
||||||
|
|
||||||
|
* lib/resolv.rb: don't use Regexp#source to embed regexps.
|
||||||
|
[ruby-dev:23432]
|
||||||
|
|
||||||
Thu Apr 22 04:15:36 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Apr 22 04:15:36 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* parse.y (aref_args): should pass expanded list. [ruby-core:02793]
|
* parse.y (aref_args): should pass expanded list. [ruby-core:02793]
|
||||||
|
@ -9,6 +14,7 @@ Wed Apr 21 22:57:27 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
|
||||||
Wed Apr 21 20:05:00 2004 Tanaka Akira <akr@m17n.org>
|
Wed Apr 21 20:05:00 2004 Tanaka Akira <akr@m17n.org>
|
||||||
|
|
||||||
* lib/open-uri.rb (URI::HTTP#proxy_open): set Host: field explicitly.
|
* lib/open-uri.rb (URI::HTTP#proxy_open): set Host: field explicitly.
|
||||||
|
[ruby-list:39542]
|
||||||
|
|
||||||
Mon Apr 19 08:19:58 2004 Doug Kearns <djkea2@mugca.its.monash.edu.au>
|
Mon Apr 19 08:19:58 2004 Doug Kearns <djkea2@mugca.its.monash.edu.au>
|
||||||
|
|
||||||
|
|
|
@ -1157,9 +1157,9 @@ class Resolv
|
||||||
@limit = @index + len
|
@limit = @index + len
|
||||||
d = yield(len)
|
d = yield(len)
|
||||||
if @index < @limit
|
if @index < @limit
|
||||||
raise DecodeError.new("junk exist")
|
raise DecodeError.new("junk exists")
|
||||||
elsif @limit < @index
|
elsif @limit < @index
|
||||||
raise DecodeError.new("limit exceed")
|
raise DecodeError.new("limit exceeded")
|
||||||
end
|
end
|
||||||
@limit = save_limit
|
@limit = save_limit
|
||||||
return d
|
return d
|
||||||
|
@ -1185,7 +1185,7 @@ class Resolv
|
||||||
raise StandardError.new("unsupported template: '#{byte.chr}' in '#{template}'")
|
raise StandardError.new("unsupported template: '#{byte.chr}' in '#{template}'")
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
raise DecodeError.new("limit exceed") if @limit < @index + len
|
raise DecodeError.new("limit exceeded") if @limit < @index + len
|
||||||
arr = @data.unpack("@#{@index}#{template}")
|
arr = @data.unpack("@#{@index}#{template}")
|
||||||
@index += len
|
@index += len
|
||||||
return arr
|
return arr
|
||||||
|
@ -1193,7 +1193,7 @@ class Resolv
|
||||||
|
|
||||||
def get_string
|
def get_string
|
||||||
len = @data[@index]
|
len = @data[@index]
|
||||||
raise DecodeError.new("limit exceed") if @limit < @index + 1 + len
|
raise DecodeError.new("limit exceeded") if @limit < @index + 1 + len
|
||||||
d = @data[@index + 1, len]
|
d = @data[@index + 1, len]
|
||||||
@index += 1 + len
|
@index += 1 + len
|
||||||
return d
|
return d
|
||||||
|
@ -1554,7 +1554,7 @@ class Resolv
|
||||||
raise ArgumentError.new("IPv4 address with invalid value: " + arg)
|
raise ArgumentError.new("IPv4 address with invalid value: " + arg)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
raise ArgumentError.new("cannot interprete as IPv4 address: #{arg.inspect}")
|
raise ArgumentError.new("cannot interpret as IPv4 address: #{arg.inspect}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1615,10 +1615,10 @@ class Resolv
|
||||||
\z/x
|
\z/x
|
||||||
|
|
||||||
Regex = /
|
Regex = /
|
||||||
(?:#{Regex_8Hex.source}) |
|
(?:#{Regex_8Hex}) |
|
||||||
(?:#{Regex_CompressedHex.source}) |
|
(?:#{Regex_CompressedHex}) |
|
||||||
(?:#{Regex_6Hex4Dec.source}) |
|
(?:#{Regex_6Hex4Dec}) |
|
||||||
(?:#{Regex_CompressedHex4Dec.source})/x
|
(?:#{Regex_CompressedHex4Dec})/x
|
||||||
|
|
||||||
def self.create(arg)
|
def self.create(arg)
|
||||||
case arg
|
case arg
|
||||||
|
@ -1662,7 +1662,7 @@ class Resolv
|
||||||
end
|
end
|
||||||
return IPv6.new(address)
|
return IPv6.new(address)
|
||||||
else
|
else
|
||||||
raise ArgumentError.new("cannot interprete as IPv6 address: #{arg.inspect}")
|
raise ArgumentError.new("cannot interpret as IPv6 address: #{arg.inspect}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1706,5 +1706,5 @@ class Resolv
|
||||||
end
|
end
|
||||||
|
|
||||||
DefaultResolver = self.new
|
DefaultResolver = self.new
|
||||||
AddressRegex = /(?:#{IPv4::Regex.source})|(?:#{IPv6::Regex.source})/
|
AddressRegex = /(?:#{IPv4::Regex})|(?:#{IPv6::Regex})/
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue