summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'object.c')
-rw-r--r--object.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/object.c b/object.c
index faf6983526..be551bd82a 100644
--- a/object.c
+++ b/object.c
@@ -721,6 +721,15 @@ f_string(obj, arg)
return rb_funcall(arg, rb_intern("to_s"), 0);
}
+char*
+str2cstr(str)
+ VALUE str;
+{
+ if (NIL_P(str)) return NULL;
+ Check_Type(str, T_STRING);
+ return RSTRING(str)->ptr;
+}
+
VALUE
rb_String(val)
VALUE val;