diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-07 06:42:44 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-07 06:42:44 +0000 |
| commit | 36fc6d293c5492a296b05cf07ae35e6c9dddc1e6 (patch) | |
| tree | c6fc296c83dc0d19f90d3e173265e3300681d3f6 | |
| parent | 3abcb8fe9d8ad9b153be91ed42435c55c9a93daf (diff) | |
| download | ruby-36fc6d293c5492a296b05cf07ae35e6c9dddc1e6.tar.gz ruby-36fc6d293c5492a296b05cf07ae35e6c9dddc1e6.tar.xz ruby-36fc6d293c5492a296b05cf07ae35e6c9dddc1e6.zip | |
* string.c (rb_str_end_with): compares with the suffix.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | string.c | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Thu Feb 7 15:42:42 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * string.c (rb_str_end_with): compares with the suffix. + Thu Feb 7 15:03:15 2008 NARUSE, Yui <naruse@ruby-lang.org> * enc/trans/korean.c: add support for CP949 by Park Ji-In. @@ -5663,7 +5663,7 @@ rb_str_end_with(int argc, VALUE *argv, VALUE str) s = p + RSTRING_LEN(str) - RSTRING_LEN(tmp); if (rb_enc_left_char_head(p, s, enc) != s) continue; - if (memcmp(s, p, RSTRING_LEN(tmp)) == 0) + if (memcmp(s, RSTRING_PTR(tmp), RSTRING_LEN(tmp)) == 0) return Qtrue; } return Qfalse; |
