summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-10-16 09:11:10 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-10-16 09:11:10 +0000
commit525836d683d8c0cc2ff2479875eb9e71bd63d151 (patch)
treeba975d888adaca536dc7803689fca06fa12daac0 /lib
parent84fbb64d7aec804c314cf0bd156a3bf078b5f9fd (diff)
shugo
* lib/net/imap.rb: don't upcase the value of ATOM token. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/net/imap.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index 7ae5bad0a7..2f806301b7 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -381,7 +381,7 @@ module Net
@sock = TCPSocket.open(host, port)
@responses = Hash.new([].freeze)
@greeting = get_response
- if @greeting.name == "BYE"
+ if /\ABYE\z/ni =~ @greeting.name
@sock.close
raise ByeResponseError, resp[0]
end
@@ -423,21 +423,21 @@ module Net
end
if resp.prefix == tag
case resp.name
- when "NO"
+ when /\ANO\z/ni
raise NoResponseError, resp[0]
- when "BAD"
+ when /\ABAD\z/ni
raise BadResponseError, resp[0]
else
return resp
end
else
if resp.prefix == "*"
- if resp.name == "BYE" &&
+ if /\ABYE\z/ni =~ resp.name &&
cmd != "LOGOUT"
raise ByeResponseError, resp[0]
end
record_response(resp.name, resp.data)
- if /\A(OK|NO|BAD)\z/n =~ resp.name &&
+ if /\A(OK|NO|BAD)\z/ni =~ resp.name &&
resp[0].instance_of?(Array)
record_response(resp[0][0], resp[0][1..-1])
end
@@ -468,6 +468,7 @@ module Net
end
def record_response(name, data)
+ name = name.upcase
unless @responses.has_key?(name)
@responses[name] = []
end
@@ -898,7 +899,7 @@ module Net
@token.value = $+.to_i
@token.symbol = T_NUMBER
elsif $3
- @token.value = $+.upcase
+ @token.value = $+
@token.symbol = T_ATOM
elsif $4
@token.value = $+.gsub(/\\(["\\])/n, "\\1")
@@ -952,7 +953,7 @@ module Net
@token.value = $+.to_i
@token.symbol = T_NUMBER
elsif $2
- @token.value = $+.upcase
+ @token.value = $+
@token.symbol = T_ATOM
elsif $3
@token.value = $+[1..-1].capitalize.intern