From 36fc6d293c5492a296b05cf07ae35e6c9dddc1e6 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 7 Feb 2008 06:42:44 +0000 Subject: * 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 --- string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'string.c') diff --git a/string.c b/string.c index 945241ca3..db6b19e68 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; -- cgit