diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-14 02:40:07 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-14 02:40:07 +0000 |
commit | 25c243bf2f5e01e91a1e3ccf17fdeb1897623488 (patch) | |
tree | 45857f80241b5834703811d5f847760c12683f02 /lib | |
parent | c9e700713454e059a3f62ec8749381fa680a61e3 (diff) |
merge revision(s) 25735:
* 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_7@26086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cgi.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/cgi.rb b/lib/cgi.rb index 6d299798e6..7ee0edc9ac 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) |