[macruby-changes] [4816] MacRuby/trunk/string.c
source_changes at macosforge.org
source_changes at macosforge.org
Sat Oct 23 13:18:55 PDT 2010
Revision: 4816
http://trac.macosforge.org/projects/ruby/changeset/4816
Author: lsansonetti at apple.com
Date: 2010-10-23 13:18:53 -0700 (Sat, 23 Oct 2010)
Log Message:
-----------
fix rb_str_split() to make sure the given string will be a rb_str_t
Modified Paths:
--------------
MacRuby/trunk/string.c
Modified: MacRuby/trunk/string.c
===================================================================
--- MacRuby/trunk/string.c 2010-10-23 12:45:44 UTC (rev 4815)
+++ MacRuby/trunk/string.c 2010-10-23 20:18:53 UTC (rev 4816)
@@ -3315,16 +3315,6 @@
return result;
}
-VALUE
-rb_str_split(VALUE str, const char *sep0)
-{
- VALUE sep;
-
- StringValue(str);
- sep = rb_str_new2(sep0);
- return rstr_split(str, 0, 1, &sep);
-}
-
/*
* call-seq:
* str.to_i(base=10) => integer
@@ -6664,6 +6654,14 @@
return (VALUE)str_simple_transcode(RSTR(str), enc);
}
+VALUE
+rb_str_split(VALUE str, const char *sep0)
+{
+ str = (VALUE)str_need_string(str);
+ VALUE sep = rb_str_new2(sep0);
+ return rstr_split(str, 0, 1, &sep);
+}
+
void
rb_str_modify(VALUE obj)
{
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101023/442e39cd/attachment.html>
More information about the macruby-changes
mailing list