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

ruby-changes:38502

From: usa <ko1@a...>
Date: Thu, 21 May 2015 14:12:50 +0900 (JST)
Subject: [ruby-changes:38502] usa:r50583 (ruby_2_1): merge revision(s) 50444: [Backport #11128]

usa	2015-05-21 14:12:20 +0900 (Thu, 21 May 2015)

  New Revision: 50583

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

  Log:
    merge revision(s) 50444: [Backport #11128]
    
    * lib/net/imap.rb (body_ext_mpart): should work even if body-fld-dsp
      is omitted.  [ruby-core:69093] [Bug #11128]

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/lib/net/imap.rb
    branches/ruby_2_1/test/net/imap/test_imap_response_parser.rb
    branches/ruby_2_1/version.h
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 50582)
+++ ruby_2_1/ChangeLog	(revision 50583)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Thu May 21 14:11:50 2015  Shugo Maeda  <shugo@r...>
+
+	* lib/net/imap.rb (body_ext_mpart): should work even if body-fld-dsp
+	  is omitted.  [ruby-core:69093] [Bug #11128]
+
 Thu May 21 14:08:15 2015  SHIBATA Hiroshi  <hsbt@r...>
 
 	* string.c: added documentation for character sequence \' with String#sub
Index: ruby_2_1/lib/net/imap.rb
===================================================================
--- ruby_2_1/lib/net/imap.rb	(revision 50582)
+++ ruby_2_1/lib/net/imap.rb	(revision 50583)
@@ -2582,7 +2582,13 @@ module Net https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/net/imap.rb#L2582
           return param
         end
         disposition = body_fld_dsp
-        match(T_SPACE)
+
+        token = lookahead
+        if token.symbol == T_SPACE
+          shift_token
+        else
+          return param, disposition
+        end
         language = body_fld_lang
 
         token = lookahead
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 50582)
+++ ruby_2_1/version.h	(revision 50583)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.7"
 #define RUBY_RELEASE_DATE "2015-05-21"
-#define RUBY_PATCHLEVEL 355
+#define RUBY_PATCHLEVEL 356
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 5
Index: ruby_2_1/test/net/imap/test_imap_response_parser.rb
===================================================================
--- ruby_2_1/test/net/imap/test_imap_response_parser.rb	(revision 50582)
+++ ruby_2_1/test/net/imap/test_imap_response_parser.rb	(revision 50583)
@@ -258,4 +258,17 @@ EOF https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/net/imap/test_imap_response_parser.rb#L258
     assert_equal(empty_part.body.subtype, 'MIXED')
     assert_equal(empty_part.body.param['BOUNDARY'], '000e0cd29212e3e06a0486590ae2')
   end
+
+  # [Bug #11128]
+  def test_body_ext_mpart_without_lang
+    parser = Net::IMAP::ResponseParser.new
+    response = parser.parse("* 4 FETCH (BODY (((\"text\" \"plain\" (\"charset\" \"utf-8\") NIL NIL \"7bit\" 257 9 NIL NIL NIL NIL)(\"text\" \"html\" (\"charset\" \"utf-8\") NIL NIL \"quoted-printable\" 655 9 NIL NIL NIL NIL) \"alternative\" (\"boundary\" \"001a1137a5047848dd05157ddaa1\") NIL)(\"application\" \"pdf\" (\"name\" \"test.xml\" \"x-apple-part-url\" \"9D00D9A2-98AB-4EFB-85BA-FB255F8BF3D7\") NIL NIL \"base64\" 4383638 NIL (\"attachment\" (\"filename\" \"test.xml\")) NIL NIL) \"mixed\" (\"boundary\" \"001a1137a5047848e405157ddaa3\") NIL))\r\n")
+    assert_equal("FETCH", response.name)
+    body = response.data.attr["BODY"]
+    assert_equal(nil, body.parts[0].disposition)
+    assert_equal(nil, body.parts[0].language)
+    assert_equal("ATTACHMENT", body.parts[1].disposition.dsp_type)
+    assert_equal("test.xml", body.parts[1].disposition.param["FILENAME"])
+    assert_equal(nil, body.parts[1].language)
+  end
 end

Property changes on: ruby_2_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r50444


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

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