From fa284f8127be2cccb3775309fd5747d79f55ca3d Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 21 Jul 2003 18:37:07 +0000 Subject: * string.c (rb_str_equal): should return nil for non string operand to conform comparable convention. [ruby-dev:20759] * object.c (rb_equal): preserve nil if "==" returns nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'string.c') diff --git a/string.c b/string.c index fc1e66cb26..c7b5ddd9f2 100644 --- a/string.c +++ b/string.c @@ -792,7 +792,7 @@ rb_str_equal(str1, str2) if (str1 == str2) return Qtrue; if (TYPE(str2) != T_STRING) { if (!rb_respond_to(str2, rb_intern("to_str"))) { - return Qfalse; + return Qnil; } return rb_equal(str2, str1); } -- cgit v1.2.3