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

ruby-changes:20954

From: shugo <ko1@a...>
Date: Fri, 19 Aug 2011 11:40:48 +0900 (JST)
Subject: [ruby-changes:20954] shugo:r33003 (ruby_1_9_3): * backport r33001 from trunk.

shugo	2011-08-19 11:39:34 +0900 (Fri, 19 Aug 2011)

  New Revision: 33003

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33003

  Log:
    * 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]

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/lib/net/imap.rb
    branches/ruby_1_9_3/test/net/imap/test_imap_response_parser.rb

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 33002)
+++ ruby_1_9_3/ChangeLog	(revision 33003)
@@ -1,3 +1,10 @@
+Fri Aug 19 11:28:58 2011  Shugo Maeda  <shugo@r...>
+
+	* 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@m...>
 
 	* backport r32996 from trunk.
Index: ruby_1_9_3/lib/net/imap.rb
===================================================================
--- ruby_1_9_3/lib/net/imap.rb	(revision 33002)
+++ ruby_1_9_3/lib/net/imap.rb	(revision 33003)
@@ -2170,7 +2170,7 @@
             break
           when T_SPACE
             shift_token
-            token = lookahead
+            next
           end
           case token.value
           when /\A(?:ENVELOPE)\z/ni
Index: ruby_1_9_3/test/net/imap/test_imap_response_parser.rb
===================================================================
--- ruby_1_9_3/test/net/imap/test_imap_response_parser.rb	(revision 33002)
+++ ruby_1_9_3/test/net/imap/test_imap_response_parser.rb	(revision 33003)
@@ -99,4 +99,21 @@
 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

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

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