[前][次][番号順一覧][スレッド一覧]

ruby-changes:49254

From: nagachika <ko1@a...>
Date: Thu, 21 Dec 2017 00:31:23 +0900 (JST)
Subject: [ruby-changes:49254] nagachika:r61369 (ruby_2_4): merge revision(s) 59372: [Backport #13649]

nagachika	2017-12-21 00:31:18 +0900 (Thu, 21 Dec 2017)

  New Revision: 61369

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61369

  Log:
    merge revision(s) 59372: [Backport #13649]
    
    lib/net/imap.rb: Ignore trailing space for Microsoft Exchange Server
    
    Based on the patch by keysen (Jeremy Carlier).
    [ruby-core:81641] [Bug #13649]

  Modified directories:
    branches/ruby_2_4/
  Modified files:
    branches/ruby_2_4/lib/net/imap.rb
    branches/ruby_2_4/test/net/imap/test_imap_response_parser.rb
    branches/ruby_2_4/version.h
Index: ruby_2_4/version.h
===================================================================
--- ruby_2_4/version.h	(revision 61368)
+++ ruby_2_4/version.h	(revision 61369)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1
 #define RUBY_VERSION "2.4.4"
 #define RUBY_RELEASE_DATE "2017-12-21"
-#define RUBY_PATCHLEVEL 216
+#define RUBY_PATCHLEVEL 217
 
 #define RUBY_RELEASE_YEAR 2017
 #define RUBY_RELEASE_MONTH 12
Index: ruby_2_4/test/net/imap/test_imap_response_parser.rb
===================================================================
--- ruby_2_4/test/net/imap/test_imap_response_parser.rb	(revision 61368)
+++ ruby_2_4/test/net/imap/test_imap_response_parser.rb	(revision 61369)
@@ -291,4 +291,17 @@ EOF https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/net/imap/test_imap_response_parser.rb#L291
     assert_equal("test.xml", body.parts[1].disposition.param["FILENAME"])
     assert_equal(nil, body.parts[1].language)
   end
+
+  # [Bug #13649]
+  def test_status
+    parser = Net::IMAP::ResponseParser.new
+    response = parser.parse("* STATUS INBOX (UIDNEXT 1 UIDVALIDITY 1234)\r\n")
+    assert_equal("STATUS", response.name)
+    assert_equal("INBOX", response.data.mailbox)
+    assert_equal(1234, response.data.attr["UIDVALIDITY"])
+    response = parser.parse("* STATUS INBOX (UIDNEXT 1 UIDVALIDITY 1234) \r\n")
+    assert_equal("STATUS", response.name)
+    assert_equal("INBOX", response.data.mailbox)
+    assert_equal(1234, response.data.attr["UIDVALIDITY"])
+  end
 end
Index: ruby_2_4/lib/net/imap.rb
===================================================================
--- ruby_2_4/lib/net/imap.rb	(revision 61368)
+++ ruby_2_4/lib/net/imap.rb	(revision 61369)
@@ -2199,6 +2199,10 @@ module Net https://github.com/ruby/ruby/blob/trunk/ruby_2_4/lib/net/imap.rb#L2199
         else
           result = response_tagged
         end
+        while lookahead.symbol == T_SPACE
+          # Ignore trailing space for Microsoft Exchange Server
+          shift_token
+        end
         match(T_CRLF)
         match(T_EOF)
         return result
Index: ruby_2_4
===================================================================
--- ruby_2_4	(revision 61368)
+++ ruby_2_4	(revision 61369)

Property changes on: ruby_2_4
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r59372

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]