From 126e7ed66febc5f20bf8d2e259b24c8f37b78621 Mon Sep 17 00:00:00 2001 From: matz Date: Sun, 9 Dec 2007 23:25:20 +0000 Subject: * object.c (rb_obj_not_match): wrong test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 2 ++ object.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 12c664ad9e..37fea8f0b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ Mon Dec 10 07:48:14 2007 Yukihiro Matsumoto * parse.y (parser_yylex): wrong token was generated. [ruby-dev:32498] + * object.c (rb_obj_not_match): wrong test. + Mon Dec 10 06:44:47 2007 Tanaka Akira * re.c (rb_reg_expr_str): use \xHH instead of \OOO. diff --git a/object.c b/object.c index 1152b855f2..1fe102f1ea 100644 --- a/object.c +++ b/object.c @@ -32,7 +32,7 @@ VALUE rb_cNilClass; VALUE rb_cTrueClass; VALUE rb_cFalseClass; -static ID id_eq, id_eql, id_inspect, id_init_copy; +static ID id_eq, id_eql, id_match, id_inspect, id_init_copy; /* * call-seq: @@ -1033,7 +1033,8 @@ rb_obj_match(VALUE obj1, VALUE obj2) static VALUE rb_obj_not_match(VALUE obj1, VALUE obj2) { - return Qtrue; + VALUE result = rb_funcall(obj1, id_match, 1, obj2); + return RTEST(result) ? Qfalse : Qtrue; } @@ -2501,6 +2502,7 @@ Init_Object(void) id_eq = rb_intern("=="); id_eql = rb_intern("eql?"); + id_match = rb_intern("=~"); id_inspect = rb_intern("inspect"); id_init_copy = rb_intern("initialize_copy"); } -- cgit v1.2.3