diff options
| author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-19 02:39:34 +0000 |
|---|---|---|
| committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-19 02:39:34 +0000 |
| commit | b824aff1aedbae2cffbdd5bf33c18e4480249be0 (patch) | |
| tree | da8f664e95163c8249d1be87443d4e7f072cf4a6 | |
| parent | bc6c037f8499bd630da8f05e8e63e65f5eef76eb (diff) | |
* backport r33001 from trunk.
* lib/net/imap.rb (msg_att): accepts extra space before ')'.
based on the patch by art lussos. [Bug #5163] [ruby-core:38820]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@33003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | lib/net/imap.rb | 2 | ||||
| -rw-r--r-- | test/net/imap/test_imap_response_parser.rb | 17 |
3 files changed, 25 insertions, 1 deletions
@@ -1,3 +1,10 @@ +Fri Aug 19 11:28:58 2011 Shugo Maeda <shugo@ruby-lang.org> + + * backport r33001 from trunk. + + * lib/net/imap.rb (msg_att): accepts extra space before ')'. + based on the patch by art lussos. [Bug #5163] [ruby-core:38820] + Wed Aug 17 15:27:00 2011 Kenta Murata <mrkn@mrkn.jp> * backport r32996 from trunk. diff --git a/lib/net/imap.rb b/lib/net/imap.rb index 724bc08e3b..1411313aae 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -2170,7 +2170,7 @@ module Net break when T_SPACE shift_token - token = lookahead + next end case token.value when /\A(?:ENVELOPE)\z/ni diff --git a/test/net/imap/test_imap_response_parser.rb b/test/net/imap/test_imap_response_parser.rb index ccdffd21ca..6a5a117408 100644 --- a/test/net/imap/test_imap_response_parser.rb +++ b/test/net/imap/test_imap_response_parser.rb @@ -99,4 +99,21 @@ EOF EOF assert_equal [1, 2, 3], response.data end + + def test_msg_att_extra_space + parser = Net::IMAP::ResponseParser.new + response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint) +* 1 FETCH (UID 92285) +EOF + assert_equal 92285, response.data.attr["UID"] + + response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint) +* 1 FETCH (UID 92285 ) +EOF + assert_equal 92285, response.data.attr["UID"] + + response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint) +* 1 FETCH (UID 92285 ) +EOF + end end |
