aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/net/imap.rb9
-rw-r--r--test/net/imap/test_imap_response_parser.rb8
3 files changed, 21 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 7de654666e..17a7604fec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Nov 14 01:26:47 2014 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/imap.rb (search_response): parse MODSEQ in SEARCH
+ responses properly. [ruby-core:64203] [Bug #10112]
+
Fri Nov 14 01:03:17 2014 Tanaka Akira <akr@fsij.org>
* test/lib/envutil.rb: Moved from test/ruby/.
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index 7bd453f864..a248d75e1b 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -2865,8 +2865,15 @@ module Net
break
when T_SPACE
shift_token
- else
+ when T_NUMBER
data.push(number)
+ when T_LPAR
+ # TODO: include the MODSEQ value in a response
+ shift_token
+ match(T_ATOM)
+ match(T_SPACE)
+ match(T_NUMBER)
+ match(T_RPAR)
end
end
else
diff --git a/test/net/imap/test_imap_response_parser.rb b/test/net/imap/test_imap_response_parser.rb
index d23e3934cb..ded7dd1eff 100644
--- a/test/net/imap/test_imap_response_parser.rb
+++ b/test/net/imap/test_imap_response_parser.rb
@@ -268,4 +268,12 @@ EOF
assert_equal(empty_part.body.subtype, 'MIXED')
assert_equal(empty_part.body.param['BOUNDARY'], '000e0cd29212e3e06a0486590ae2')
end
+
+ # [Bug #10112]
+ def test_search_modseq
+ parser = Net::IMAP::ResponseParser.new
+ response = parser.parse("* SEARCH 87216 87221 (MODSEQ 7667567)\r\n")
+ assert_equal("SEARCH", response.name)
+ assert_equal([87216, 87221], response.data)
+ end
end