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

source_changes at macosforge.org source_changes at macosforge.org
Wed May 5 20:35:31 PDT 2010


Revision: 4028
          http://trac.macosforge.org/projects/ruby/changeset/4028
Author:   martinlagardette at apple.com
Date:     2010-05-05 20:35:26 -0700 (Wed, 05 May 2010)
Log Message:
-----------
#sysread with a len argument must return a binary string, not UTF-8

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

Modified: MacRuby/trunk/io.c
===================================================================
--- MacRuby/trunk/io.c	2010-05-06 01:48:58 UTC (rev 4027)
+++ MacRuby/trunk/io.c	2010-05-06 03:35:26 UTC (rev 4028)
@@ -1126,7 +1126,10 @@
 
     if (NIL_P(len)) {
 	rb_io_read_all(io_struct, outbuf);
-	goto bail;
+	if (outbuf_created) {
+	    rb_str_force_encoding(outbuf, rb_encodings[ENCODING_UTF8]);
+	}
+	return outbuf;
     }
 
     const long size = FIX2LONG(len);
@@ -1151,10 +1154,6 @@
     }
     rb_bstr_set_length(outbuf, data_read);
 
-bail:
-    if (outbuf_created) {
-	rb_str_force_encoding(outbuf, rb_encodings[ENCODING_UTF8]);
-    }
     return outbuf;
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100505/cbeba31b/attachment-0001.html>


More information about the macruby-changes mailing list