ruby-changes:26778
From: usa <ko1@a...>
Date: Tue, 15 Jan 2013 16:23:58 +0900 (JST)
Subject: [ruby-changes:26778] usa:r38830 (ruby_1_9_3): merge revision(s) 37487,37563: [Backport #7278]
usa 2013-01-15 16:23:48 +0900 (Tue, 15 Jan 2013) New Revision: 38830 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38830 Log: merge revision(s) 37487,37563: [Backport #7278] * lib/net/protocol.rb (Net::InternetMessageIO#each_crlf_line): don't use /n in universal regexp. [ruby-dev:46394] [Bug #7278] * lib/net/protocol.rb (Net::InternetMessageIO#each_crlf_line): treat \r as newline as mame pointed. [ruby-dev:46425] [Bug #7278] Added directories: branches/ruby_1_9_3/test/net/protocol/ Modified directories: branches/ruby_1_9_3/ Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/lib/net/protocol.rb branches/ruby_1_9_3/test/net/protocol/test_protocol.rb branches/ruby_1_9_3/version.h Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 38829) +++ ruby_1_9_3/ChangeLog (revision 38830) @@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1 +Tue Jan 15 16:23:30 2013 NARUSE, Yui <naruse@r...> + + * lib/net/protocol.rb (Net::InternetMessageIO#each_crlf_line): + treat \r as newline as mame pointed. [ruby-dev:46425] [Bug #7278] + +Tue Jan 15 16:23:30 2013 NARUSE, Yui <naruse@r...> + + * lib/net/protocol.rb (Net::InternetMessageIO#each_crlf_line): + don't use /n in universal regexp. [ruby-dev:46394] [Bug #7278] + Tue Jan 15 16:13:47 2013 Kenta Murata <mrkn@m...> * ext/bigdecimal/bigdecimal.c (BigDecimal_to_s): use CRuby style. Index: ruby_1_9_3/lib/net/protocol.rb =================================================================== --- ruby_1_9_3/lib/net/protocol.rb (revision 38829) +++ ruby_1_9_3/lib/net/protocol.rb (revision 38830) @@ -310,7 +310,7 @@ module Net # :nodoc: https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/lib/net/protocol.rb#L310 def each_crlf_line(src) buffer_filling(@wbuf, src) do - while line = @wbuf.slice!(/\A.*(?:\n|\r\n|\r(?!\z))/n) + while line = @wbuf.slice!(/\A[^\r\n]*(?:\n|\r(?:\n|(?!\z)))/) yield line.chomp("\n") + "\r\n" end end Index: ruby_1_9_3/version.h =================================================================== --- ruby_1_9_3/version.h (revision 38829) +++ ruby_1_9_3/version.h (revision 38830) @@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1 #define RUBY_VERSION "1.9.3" -#define RUBY_PATCHLEVEL 370 +#define RUBY_PATCHLEVEL 371 #define RUBY_RELEASE_DATE "2013-01-15" #define RUBY_RELEASE_YEAR 2013 Index: ruby_1_9_3/test/net/protocol/test_protocol.rb =================================================================== --- ruby_1_9_3/test/net/protocol/test_protocol.rb (revision 0) +++ ruby_1_9_3/test/net/protocol/test_protocol.rb (revision 38830) @@ -0,0 +1,19 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/test/net/protocol/test_protocol.rb#L1 +require "test/unit" +require "net/protocol" +require "stringio" + +class TestProtocol < Test::Unit::TestCase + def test_each_crlf_line + assert_output('', '') do + sio = StringIO.new("") + imio = Net::InternetMessageIO.new(sio) + assert_equal(23, imio.write_message("\u3042\r\u3044\n\u3046\r\n\u3048")) + assert_equal("\u3042\r\n\u3044\r\n\u3046\r\n\u3048\r\n.\r\n", sio.string) + + sio = StringIO.new("") + imio = Net::InternetMessageIO.new(sio) + assert_equal(8, imio.write_message("\u3042\r")) + assert_equal("\u3042\r\n.\r\n", sio.string) + end + end +end Property changes on: ruby_1_9_3 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r37487,37563 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/