summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-03-06 04:15:42 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-03-06 04:15:42 +0000
commitd7b8e448bfd29042f64ed3535dc21014b9259088 (patch)
tree095315717e3050b4acb09d91e848dc2e3d0b2b5f /lib
parentb014cc337ef28498311f58a7b28bdfffebc53f00 (diff)
2000-03-06
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/cgi.rb5
-rw-r--r--lib/pstore.rb4
-rw-r--r--lib/weakref.rb2
3 files changed, 8 insertions, 3 deletions
diff --git a/lib/cgi.rb b/lib/cgi.rb
index e2ba314..b973904 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -648,10 +648,12 @@ convert string charset, and set language to "ja".
=end
def Cookie::parse(raw_cookie)
cookies = Hash.new([])
+ return cookies unless raw_cookie
raw_cookie.split('; ').each do |pairs|
name, values = pairs.split('=',2)
name = CGI::unescape(name)
+ values ||= ""
values = values.split('&').filter{|v| CGI::unescape(v) }
if cookies.has_key?(name)
cookies[name].value.push(*values)
@@ -877,8 +879,7 @@ convert string charset, and set language to "ja".
)
end
- @cookies = CGI::Cookie::parse((env_table['HTTP_COOKIE'] or
- env_table['COOKIE'] or ""))
+ @cookies = CGI::Cookie::parse((env_table['HTTP_COOKIE'] or env_table['COOKIE']))
end
private :initialize_query
diff --git a/lib/pstore.rb b/lib/pstore.rb
index 9ea9ab3..05fa5dc 100644
--- a/lib/pstore.rb
+++ b/lib/pstore.rb
@@ -52,6 +52,10 @@ class PStore
in_transaction
@table[name] = value
end
+ def delete(name)
+ in_transaction
+ @table.delete name
+ end
def roots
in_transaction
diff --git a/lib/weakref.rb b/lib/weakref.rb
index c6fe8cd..18b530f 100644
--- a/lib/weakref.rb
+++ b/lib/weakref.rb
@@ -40,7 +40,7 @@ class WeakRef<Delegator
ObjectSpace.call_finalizer orig
ObjectSpace.call_finalizer self
ID_MAP[@__id] = [] unless ID_MAP[@__id]
- ID_MAP[@__id].concat self.__id__
+ ID_MAP[@__id].push self.__id__
ID_REV_MAP[self.id] = @__id
end