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

ruby-changes:13443

From: xibbar <ko1@a...>
Date: Sun, 4 Oct 2009 01:15:38 +0900 (JST)
Subject: [ruby-changes:13443] Ruby:r25216 (trunk): * lib/cgi/core.rb: fix command-line option of

xibbar	2009-10-04 01:15:23 +0900 (Sun, 04 Oct 2009)

  New Revision: 25216

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

  Log:
    * lib/cgi/core.rb: fix command-line option of
      non-interactive terminal. [ruby-core:23016]

  Modified files:
    trunk/ChangeLog
    trunk/lib/cgi/core.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 25215)
+++ ChangeLog	(revision 25216)
@@ -1,3 +1,8 @@
+Sun Oct  4 00:59:52 2009  Takeyuki FUJIOKA  <xibbar@r...>
+
+	* lib/cgi/core.rb: fix command-line option of
+	  non-interactive terminal. [ruby-core:23016]
+
 Sun Oct  4 00:40:18 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib/rake/contrib: added.  [ruby-core:25918]
Index: lib/cgi/core.rb
===================================================================
--- lib/cgi/core.rb	(revision 25215)
+++ lib/cgi/core.rb	(revision 25216)
@@ -555,12 +555,21 @@
             %|(offline mode: enter name=value pairs on standard input)\n|
           )
         end
-        readlines.join(' ').gsub(/\n/, '')
-      end.gsub(/\\=/, '%3D').gsub(/\\&/, '%26')
+        array = nil
+        begin
+            readlines
+        rescue
+        end
+        if not array.nil?
+            array.join(' ').gsub(/\n/n, '')
+        else
+            ""
+        end
+      end.gsub(/\\=/n, '%3D').gsub(/\\&/n, '%26')
 
       words = Shellwords.shellwords(string)
 
-      if words.find{|x| /=/.match(x) }
+      if words.find{|x| /=/n.match(x) }
         words.join('&')
       else
         words.join('+')

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

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