[macruby-changes] [4784] MacRuby/trunk/file.c

source_changes at macosforge.org source_changes at macosforge.org
Mon Oct 11 05:38:07 PDT 2010


Revision: 4784
          http://trac.macosforge.org/projects/ruby/changeset/4784
Author:   watson1978 at gmail.com
Date:     2010-10-11 05:38:05 -0700 (Mon, 11 Oct 2010)
Log Message:
-----------
Fixed a bug of File#size. Should throw an IOError exception when calls with closed stream.

Test Script:
{{{
f = File.open("/usr/local/bin/macruby")
f.close
begin
  f.size
rescue IOError => err
  p "ok : " + err.inspect
end
}}}

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

Modified: MacRuby/trunk/file.c
===================================================================
--- MacRuby/trunk/file.c	2010-10-10 20:21:56 UTC (rev 4783)
+++ MacRuby/trunk/file.c	2010-10-11 12:38:05 UTC (rev 4784)
@@ -1529,6 +1529,7 @@
 {
     struct stat st;
     struct rb_io_t *io = ExtractIOStruct(obj);
+    rb_io_check_closed(io);
     if (fstat(io->fd, &st) == -1) {
 	rb_sys_fail(RSTRING_PTR(io->path));
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101011/0f4902dd/attachment.html>


More information about the macruby-changes mailing list