[macruby-changes] [4557] MacRuby/trunk/ext/zlib/zlib.c

source_changes at macosforge.org source_changes at macosforge.org
Tue Sep 28 18:14:33 PDT 2010


Revision: 4557
          http://trac.macosforge.org/projects/ruby/changeset/4557
Author:   watson1978 at gmail.com
Date:     2010-09-28 18:14:30 -0700 (Tue, 28 Sep 2010)
Log Message:
-----------
Zlib::GzipReader#getc should return a character.

Modified Paths:
--------------
    MacRuby/trunk/ext/zlib/zlib.c

Modified: MacRuby/trunk/ext/zlib/zlib.c
===================================================================
--- MacRuby/trunk/ext/zlib/zlib.c	2010-09-29 00:44:16 UTC (rev 4556)
+++ MacRuby/trunk/ext/zlib/zlib.c	2010-09-29 01:14:30 UTC (rev 4557)
@@ -2866,13 +2866,8 @@
 rb_gzreader_getc(VALUE obj, SEL sel)
 {
     struct gzfile *gz = get_gzfile(obj);
-    VALUE dst;
 
-    dst = gzfile_read(gz, 1);
-    if (!NIL_P(dst)) {
-	dst = INT2FIX((unsigned int)(BSTRING_PTR(dst)[0]) & 0xff);
-    }
-    return dst;
+    return gzfile_read(gz, 1);
 }
 
 /*
@@ -2900,6 +2895,7 @@
     RETURN_ENUMERATOR(obj, 0, 0);
 
     while (!NIL_P(c = rb_gzreader_getc(obj, 0))) {
+	c = INT2FIX((unsigned int)(BSTRING_PTR(c)[0]) & 0xff);
 	rb_yield(c);
     }
     return Qnil;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100928/8ee2ede5/attachment.html>


More information about the macruby-changes mailing list