diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-09 23:25:20 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-09 23:25:20 +0000 |
| commit | 0296ba2fca3710fc5d143f194edd7258eae539e2 (patch) | |
| tree | f26af3752011849bac105d97e7185bbc42c35395 | |
| parent | 962cd8c9f18ba80a8fb16455ee8c78f665e916f3 (diff) | |
| download | ruby-0296ba2fca3710fc5d143f194edd7258eae539e2.tar.gz ruby-0296ba2fca3710fc5d143f194edd7258eae539e2.tar.xz ruby-0296ba2fca3710fc5d143f194edd7258eae539e2.zip | |
* object.c (rb_obj_not_match): wrong test.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 2 | ||||
| -rw-r--r-- | object.c | 6 |
2 files changed, 6 insertions, 2 deletions
@@ -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. @@ -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"); } |
