[macruby-changes] [213] MacRuby/trunk/file.c

source_changes at macosforge.org source_changes at macosforge.org
Fri May 23 12:34:16 PDT 2008


Revision: 213
          http://trac.macosforge.org/projects/ruby/changeset/213
Author:   lsansonetti at apple.com
Date:     2008-05-23 12:34:15 -0700 (Fri, 23 May 2008)

Log Message:
-----------
fixed File.join making sure we do not concat bytestrings

Modified Paths:
--------------
    MacRuby/trunk/file.c

Modified: MacRuby/trunk/file.c
===================================================================
--- MacRuby/trunk/file.c	2008-05-23 09:02:27 UTC (rev 212)
+++ MacRuby/trunk/file.c	2008-05-23 19:34:15 UTC (rev 213)
@@ -3208,10 +3208,11 @@
 rb_file_join(VALUE ary, VALUE sep)
 {
 #if WITH_OBJC
-    VALUE mstr;
+    CFMutableStringRef mstr;
     long count;
 
-    mstr = rb_str_new(0, 0);
+    mstr = CFStringCreateMutable(NULL, 0);
+
     count = RARRAY_LEN(ary);
     if (count > 0) {
 	long i;
@@ -3227,11 +3228,11 @@
 		    FilePathStringValue(tmp);
 	    }
 	    if (i > 0)
-		rb_str_buf_append(mstr, sep);
-	    rb_str_buf_append(mstr, tmp);
+		CFStringAppend(mstr, (CFStringRef)sep);
+	    CFStringAppend(mstr, (CFStringRef)tmp);
 	}
     }
-    return mstr;
+    return (VALUE)mstr;
 #else
     long len, i, count;
     VALUE result, tmp;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080523/47772cf4/attachment-0001.htm 


More information about the macruby-changes mailing list