[macruby-changes] [178] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Mon Apr 28 18:53:24 PDT 2008


Revision: 178
          http://trac.macosforge.org/projects/ruby/changeset/178
Author:   lsansonetti at apple.com
Date:     2008-04-28 18:53:23 -0700 (Mon, 28 Apr 2008)

Log Message:
-----------
fixing more regressions

Modified Paths:
--------------
    MacRuby/trunk/io.c
    MacRuby/trunk/string.c

Modified: MacRuby/trunk/io.c
===================================================================
--- MacRuby/trunk/io.c	2008-04-28 05:16:37 UTC (rev 177)
+++ MacRuby/trunk/io.c	2008-04-29 01:53:23 UTC (rev 178)
@@ -1845,6 +1845,7 @@
 	}
     }
 
+    RSTRING_SYNC(str);
     str = io_enc_str(str, fptr);
     if (!fptr->enc2) ENC_CODERANGE_SET(str, cr);
     fptr->lineno++;

Modified: MacRuby/trunk/string.c
===================================================================
--- MacRuby/trunk/string.c	2008-04-28 05:16:37 UTC (rev 177)
+++ MacRuby/trunk/string.c	2008-04-29 01:53:23 UTC (rev 178)
@@ -220,13 +220,16 @@
 		kCFStringEncodingUTF8,
 		false,
 		kCFAllocatorNull);
-	CFStringReplaceAll((CFMutableStringRef)str, (CFStringRef)bytestr);
-	strptr = RSTRING_CPTR(str);
-	if ((const char *)dataptr == strptr
-	    || dataptr == NULL 
-	    || strptr == NULL
-	    || memcmp((const char *)dataptr, strptr, datalen) == 0) {
-	    s->cfdata = NULL;
+	if (bytestr != NULL) {
+	    CFStringReplaceAll((CFMutableStringRef)str, (CFStringRef)bytestr);
+	    CFRelease(bytestr);
+	    strptr = RSTRING_CPTR(str);
+	    if ((const char *)dataptr == strptr
+		    || dataptr == NULL 
+		    || strptr == NULL
+		    || memcmp((const char *)dataptr, strptr, datalen) == 0) {
+		s->cfdata = NULL;
+	    }
 	}
     }
 }
@@ -8165,7 +8168,9 @@
     rb_define_method(rb_cString, "<=>", rb_str_cmp_m, 1);
     rb_define_method(rb_cString, "==", rb_str_equal, 1);
     rb_define_method(rb_cString, "eql?", rb_str_eql, 1);
-#if !WITH_OBJC
+#if 1 
+/* FIXME remove me once we use the objc dispatch for everything
+/*#if !WITH_OBJC*/
     rb_define_method(rb_cString, "hash", rb_str_hash_m, 0);
 #endif
     rb_define_method(rb_cString, "casecmp", rb_str_casecmp, 1);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080428/35096f68/attachment.html


More information about the macruby-changes mailing list