diff --git a/ChangeLog b/ChangeLog index a0b4bae4d1..fbe2ded9ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Jan 11 16:52:05 2010 NARUSE, Yui + + * string.c (rb_str_strlen): added. [ruby-dev:40028] + + * include/ruby/intern.h (rb_str_strlen): declared. + Mon Jan 11 13:30:35 2010 Nobuyoshi Nakada * lib/webrick/accesslog.rb (WEBrick::AccessLog#format): fixed typo. diff --git a/include/ruby/intern.h b/include/ruby/intern.h index 14e23b857d..116afa520b 100644 --- a/include/ruby/intern.h +++ b/include/ruby/intern.h @@ -662,6 +662,7 @@ VALUE rb_str_associated(VALUE); void rb_str_setter(VALUE, ID, VALUE*); VALUE rb_str_intern(VALUE); VALUE rb_sym_to_s(VALUE); +long rb_str_strlen(VALUE); VALUE rb_str_length(VALUE); long rb_str_offset(VALUE, long); size_t rb_str_capacity(VALUE); diff --git a/string.c b/string.c index 2dcc3305af..78620b8048 100644 --- a/string.c +++ b/string.c @@ -1079,6 +1079,12 @@ str_strlen(VALUE str, rb_encoding *enc) return n; } +long +rb_str_strlen(VALUE str) +{ + return str_strlen(str, STR_ENC_GET(str)); +} + /* * call-seq: * str.length => integer