summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-10-31 07:06:47 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-10-31 07:06:47 +0000
commit7e953f2d81f7a68abdd711180b56246b5d1a83dc (patch)
treee8447c17f494907a4c8de56f2b190d84ff002103 /lib
parentee7642a1b9dcd7ccf6dbcd6973fb99f13200d3a5 (diff)
downloadruby-7e953f2d81f7a68abdd711180b56246b5d1a83dc.tar.gz
ruby-7e953f2d81f7a68abdd711180b56246b5d1a83dc.tar.xz
ruby-7e953f2d81f7a68abdd711180b56246b5d1a83dc.zip
shugo
* lib/net/imap.rb (ResponseParser#address): bug fix. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/net/imap.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index dd3cb72de..9d0ef0284 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -1512,10 +1512,15 @@ module Net
if @str.index(ADDRESS_REGEXP, @pos)
# address does not include literal.
@pos = $~.end(0)
- name = $1 ? $1.gsub(/\\(["\\])/n, "\\1") : nil
- route = $2 ? $2.gsub(/\\(["\\])/n, "\\1") : nil
- mailbox = $3 ? $3.gsub(/\\(["\\])/n, "\\1") : nil
- host = $4 ? $4.gsub(/\\(["\\])/n, "\\1") : nil
+ name = $1
+ route = $2
+ mailbox = $3
+ host = $4
+ for s in [name, route, mailbox, host]
+ if s
+ s.gsub!(/\\(["\\])/n, "\\1")
+ end
+ end
else
name = nstring
match(T_SPACE)