aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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");
}