summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-29 02:30:08 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-29 02:30:08 +0000
commit91d2e58f1dab1c7ef4a234cdb38935c6719f8fc1 (patch)
tree21d5ce9dc97ee634976c1977fb7db008a9b1182e
parent27ce94a366932d35f1f9ee428b86d8985fa6cbea (diff)
* parse.y (ret_args): node may be NULL. [ruby-talk:84530]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--lib/cgi.rb2
-rw-r--r--parse.y2
3 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 71e5ef1..ffbd5e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Oct 29 11:27:39 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * parse.y (ret_args): node may be NULL. [ruby-talk:84530]
+
Tue Oct 28 15:20:12 2003 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/tcltklib/tcltklib.c (VwaitVarProc, ip_rbVwaitObjCmd,
diff --git a/lib/cgi.rb b/lib/cgi.rb
index c380f9a..8231870 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -891,7 +891,7 @@ class CGI
# # "name2" => ["value1", "value2", ...], ... }
#
def CGI::parse(query)
- params = Hash.new([])
+ params = Hash.new{|hash,key|hash[key]=[]}
query.split(/[&;]/n).each do |pairs|
key, value = pairs.split('=',2).collect{|v| CGI::unescape(v) }
diff --git a/parse.y b/parse.y
index 7901bca..75fa33e 100644
--- a/parse.y
+++ b/parse.y
@@ -5366,7 +5366,7 @@ ret_args(node)
if (nd_type(node) == NODE_ARRAY && node->nd_next == 0) {
node = node->nd_head;
}
- if (nd_type(node) == NODE_SPLAT) {
+ if (node && nd_type(node) == NODE_SPLAT) {
node = NEW_SVALUE(node);
}
}