summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-07 06:42:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-07 06:42:44 +0000
commit6c6ae9866342519b775b243535aa223fadc010e9 (patch)
treec6fc296c83dc0d19f90d3e173265e3300681d3f6 /string.c
parente22ff0c9b6396c132ff812ae80bc91f0018653be (diff)
* string.c (rb_str_end_with): compares with the suffix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index 945241ca3d..db6b19e68c 100644
--- a/string.c
+++ b/string.c
@@ -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;