mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
use STR2CSTR
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@46 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7a249d7acc
commit
2f99f3b41a
3 changed files with 14 additions and 0 deletions
9
object.c
9
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue