[macruby-changes] [1620] MacRuby/branches/experimental

source_changes at macosforge.org source_changes at macosforge.org
Wed May 27 18:53:16 PDT 2009


Revision: 1620
          http://trac.macosforge.org/projects/ruby/changeset/1620
Author:   lsansonetti at apple.com
Date:     2009-05-27 18:53:15 -0700 (Wed, 27 May 2009)
Log Message:
-----------
misc change

Modified Paths:
--------------
    MacRuby/branches/experimental/MacRuby.m
    MacRuby/branches/experimental/io.c

Modified: MacRuby/branches/experimental/MacRuby.m
===================================================================
--- MacRuby/branches/experimental/MacRuby.m	2009-05-28 01:52:37 UTC (rev 1619)
+++ MacRuby/branches/experimental/MacRuby.m	2009-05-28 01:53:15 UTC (rev 1620)
@@ -97,7 +97,7 @@
 
 	argc = 1;
 	va_start(args, firstArg);
-	while (va_arg(args, id)) {
+	while (va_arg(args, id) != NULL) {
 	    argc++;
 	}
 	va_end(args);

Modified: MacRuby/branches/experimental/io.c
===================================================================
--- MacRuby/branches/experimental/io.c	2009-05-28 01:52:37 UTC (rev 1619)
+++ MacRuby/branches/experimental/io.c	2009-05-28 01:53:15 UTC (rev 1620)
@@ -830,15 +830,21 @@
 	    break;
 	}
 	else if (code == -1) {
-		CFErrorRef er = CFReadStreamCopyError(readStream);
-		CFStringRef failure_reason = CFErrorCopyFailureReason(er);
-		if(failure_reason != NULL) {
-			CFStringRef pretty = CFStringCreateWithFormat(NULL, NULL,
-				CFSTR("Internal error while reading stream: %@"), failure_reason);
-			if(pretty != NULL)
-				rb_raise(rb_eRuntimeError, "%s", (char*)CFStringGetCharactersPtr(pretty));
+	    CFErrorRef er = CFReadStreamCopyError(readStream);
+	    CFStringRef failure_reason = CFErrorCopyFailureReason(er);
+	    CFRelease(er);
+	    if (failure_reason != NULL) {
+		CFShow(failure_reason);
+		CFStringRef pretty = CFStringCreateWithFormat(NULL, NULL,
+			CFSTR("Internal error while reading stream: %@"),
+			failure_reason);
+		CFRelease(failure_reason);
+		if (pretty != NULL) {
+		    rb_raise(rb_eRuntimeError, "%s",
+			    (char*)CFStringGetCharactersPtr(pretty));
 		}
-		rb_raise(rb_eRuntimeError, "internal error while reading stream:");
+	    }
+	    rb_raise(rb_eRuntimeError, "internal error while reading stream:");
 	}
 
 	data_read += code;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090527/36c23c43/attachment.html>


More information about the macruby-changes mailing list