ruby-changes:13985
From: ryan <ko1@a...>
Date: Mon, 16 Nov 2009 12:59:34 +0900 (JST)
Subject: [ruby-changes:13985] Ruby:r25793 (ruby_1_8): Rolled out last change
ryan 2009-11-16 12:57:14 +0900 (Mon, 16 Nov 2009) New Revision: 25793 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25793 Log: Rolled out last change Modified files: branches/ruby_1_8/lib/cgi.rb Index: ruby_1_8/lib/cgi.rb =================================================================== --- ruby_1_8/lib/cgi.rb (revision 25792) +++ ruby_1_8/lib/cgi.rb (revision 25793) @@ -971,7 +971,7 @@ end def read_multipart(boundary, content_length) - params = Hash.new { |h,k| h[k] = [] } + params = Hash.new([]) boundary = "--" + boundary quoted_boundary = Regexp.quote(boundary, "n") buf = "" @@ -1063,8 +1063,11 @@ /Content-Disposition:.* name="?([^\";\s]*)"?/ni.match(head) name = $1.dup - params[name].push(body) - + if params.has_key?(name) + params[name].push(body) + else + params[name] = [body] + end break if buf.size == 0 break if content_length == -1 end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/