summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorxibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-12 14:39:48 +0000
committerxibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-12 14:39:48 +0000
commit0ef183ec8401a5d44b1ad7bde20d3c960b42798a (patch)
tree07a1c6bde1cc00229d71eea285e5ee11554d61a4 /lib
parentaaee331c7ffce5bf704a717d1b7ae73564e2d59f (diff)
* lib/cgi.rb: fix command-line option of
non-interactive terminal. [ruby-core:23016] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/cgi.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/cgi.rb b/lib/cgi.rb
index 8b367430a8..8598cff6c6 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -1089,7 +1089,12 @@ class CGI
%|(offline mode: enter name=value pairs on standard input)\n|
)
end
- readlines.join(' ').gsub(/\n/n, '')
+ array = readlines rescue nil
+ if not array.nil?
+ array.join(' ').gsub(/\n/n, '')
+ else
+ ""
+ end
end.gsub(/\\=/n, '%3D').gsub(/\\&/n, '%26')
words = Shellwords.shellwords(string)