aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-09 23:25:20 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-09 23:25:20 +0000
commit126e7ed66febc5f20bf8d2e259b24c8f37b78621 (patch)
treef26af3752011849bac105d97e7185bbc42c35395
parent862b6b68a4ca21026e925b6fba0a81ebe0e70f84 (diff)
downloadruby-126e7ed66febc5f20bf8d2e259b24c8f37b78621.tar.gz
* 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
-rw-r--r--ChangeLog2
-rw-r--r--object.c6
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 <matz@ruby-lang.org>
* 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 <akr@fsij.org>
* 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");
}