summaryrefslogtreecommitdiff
path: root/ext/-test-/string/cstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/-test-/string/cstr.c')
-rw-r--r--ext/-test-/string/cstr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/-test-/string/cstr.c b/ext/-test-/string/cstr.c
index 50214bb..81edbb0 100644
--- a/ext/-test-/string/cstr.c
+++ b/ext/-test-/string/cstr.c
@@ -40,9 +40,17 @@ bug_str_cstr_term_char(VALUE str)
return c ? rb_enc_uint_chr((unsigned int)c, enc) : Qnil;
}
+static VALUE
+bug_str_s_cstr_term_char(VALUE self, VALUE str)
+{
+ Check_Type(str, T_STRING);
+ return bug_str_cstr_term_char(str);
+}
+
void
Init_cstr(VALUE klass)
{
rb_define_method(klass, "cstr_term", bug_str_cstr_term, 0);
rb_define_method(klass, "cstr_term_char", bug_str_cstr_term_char, 0);
+ rb_define_singleton_method(klass, "cstr_term_char", bug_str_s_cstr_term_char, 1);
}