Skip to content

Commit 772e977

Browse files
committed
* lib/net/imap.rb (search_response): parse MODSEQ in SEARCH
responses properly. [ruby-core:64203] [Bug ruby#10112] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent e84e56d commit 772e977

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Fri Nov 14 01:26:47 2014 Shugo Maeda <shugo@ruby-lang.org>
2+
3+
* lib/net/imap.rb (search_response): parse MODSEQ in SEARCH
4+
responses properly. [ruby-core:64203] [Bug #10112]
5+
16
Fri Nov 14 01:03:17 2014 Tanaka Akira <akr@fsij.org>
27

38
* test/lib/envutil.rb: Moved from test/ruby/.

lib/net/imap.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2865,8 +2865,15 @@ def search_response
28652865
break
28662866
when T_SPACE
28672867
shift_token
2868-
else
2868+
when T_NUMBER
28692869
data.push(number)
2870+
when T_LPAR
2871+
# TODO: include the MODSEQ value in a response
2872+
shift_token
2873+
match(T_ATOM)
2874+
match(T_SPACE)
2875+
match(T_NUMBER)
2876+
match(T_RPAR)
28702877
end
28712878
end
28722879
else

test/net/imap/test_imap_response_parser.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,4 +268,12 @@ def test_mixed_boundry
268268
assert_equal(empty_part.body.subtype, 'MIXED')
269269
assert_equal(empty_part.body.param['BOUNDARY'], '000e0cd29212e3e06a0486590ae2')
270270
end
271+
272+
# [Bug #10112]
273+
def test_search_modseq
274+
parser = Net::IMAP::ResponseParser.new
275+
response = parser.parse("* SEARCH 87216 87221 (MODSEQ 7667567)\r\n")
276+
assert_equal("SEARCH", response.name)
277+
assert_equal([87216, 87221], response.data)
278+
end
271279
end

0 commit comments

Comments
 (0)