[macruby-changes] [4336] MacRuby/trunk/io.c

source_changes at macosforge.org source_changes at macosforge.org
Thu Jul 8 16:55:34 PDT 2010


Revision: 4336
          http://trac.macosforge.org/projects/ruby/changeset/4336
Author:   martinlagardette at apple.com
Date:     2010-07-08 16:55:33 -0700 (Thu, 08 Jul 2010)
Log Message:
-----------
`IO#syswrite`: Always check if there is a buffer before getting it's length

 - Fixes #778

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

Modified: MacRuby/trunk/io.c
===================================================================
--- MacRuby/trunk/io.c	2010-07-08 23:45:37 UTC (rev 4335)
+++ MacRuby/trunk/io.c	2010-07-08 23:55:33 UTC (rev 4336)
@@ -400,7 +400,7 @@
 
     data = rb_str_bstr(rb_obj_as_string(data));
     
-    if (CFDataGetLength(io_struct->buf) > 0) {
+    if (io_struct->buf && CFDataGetLength(io_struct->buf) > 0) {
 	rb_warn("Calling #syswrite on buffered I/O may lead to unexpected results");
     }
     
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100708/9e91ea43/attachment.html>


More information about the macruby-changes mailing list