From deed6fbb6dba5082ab5627e0181598761cccb081 Mon Sep 17 00:00:00 2001 From: wyhaines Date: Thu, 10 Jun 2010 13:53:27 +0000 Subject: lib/uri/generic.rb: Backport #2428 [ruby-core:27019]; fixed #eql? so that it can handle being passed a nil value. test/generic/test_generic.rb: added a test for the fix to #eql?. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@28255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 9 +++++++-- lib/uri/generic.rb | 1 + test/uri/test_generic.rb | 8 ++++++++ version.h | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd3f6e115d..30dddbc9fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,13 @@ +Thu Jun 10 22:50:00 Kirk Haines + + * lib/uri/generic.rb: Backport #2428 [ruby-core:27019]; fixed #eql? so that it can handle being passed a nil value. + * test/generic/test_generic.rb: added a test for the fix to #eql?. + Thu Jun 10 06:46:00 Kirk Haines - * ext/nkf/nkf-utf8/nkf.c: Backport #2953 [ruby-dev:40606]; change nkf_char buffer in numchar_getc() size form 8 to 10 to avoid potential for a segfault. + * ext/nkf/nkf-utf8/nkf.c: Backport #2953 [ruby-dev:40606]; change nkf_char buffer in numchar_getc() size form 8 to 10 to avoid potential for a segfault. r28242 - * test/nkf/test_nkf.rb: Added a test for the change. + * test/nkf/test_nkf.rb: Added a test for the change. r28242 Thu Jun 10 01:40:00 Kirk Haines diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb index 88b5078466..f26e82ed23 100644 --- a/lib/uri/generic.rb +++ b/lib/uri/generic.rb @@ -1054,6 +1054,7 @@ module URI end def eql?(oth) + self.class == oth.class && self.component_ary.eql?(oth.component_ary) end diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb index 8a7feb4982..33c8ab91d3 100644 --- a/test/uri/test_generic.rb +++ b/test/uri/test_generic.rb @@ -692,6 +692,14 @@ class TestGeneric < Test::Unit::TestCase assert_raises(URI::InvalidURIError) { uri.path = 'bar' } assert_raises(URI::InvalidURIError) { uri.query = 'bar' } end + + def test_eql + require 'uri' + uri = URI.parse 'http://gemcutter.org' + + assert_equal(false,uri.eql?(nil)) # => blows up prior to the bug fix for Backport #2428 [ruby-core:27019] + end + end diff --git a/version.h b/version.h index 358aad7598..4f5f35c267 100644 --- a/version.h +++ b/version.h @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2010-06-10" #define RUBY_VERSION_CODE 186 #define RUBY_RELEASE_CODE 20100610 -#define RUBY_PATCHLEVEL 413 +#define RUBY_PATCHLEVEL 414 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 -- cgit v1.2.3