[macruby-changes] [2055] MacRuby/branches/experimental/io.c

source_changes at macosforge.org source_changes at macosforge.org
Wed Jul 22 17:06:34 PDT 2009


Revision: 2055
          http://trac.macosforge.org/projects/ruby/changeset/2055
Author:   pthomson at apple.com
Date:     2009-07-22 17:06:31 -0700 (Wed, 22 Jul 2009)
Log Message:
-----------
Made the STDIN, STDOUT, and STDERR constants have a nice printable path.

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

Modified: MacRuby/branches/experimental/io.c
===================================================================
--- MacRuby/branches/experimental/io.c	2009-07-22 23:43:29 UTC (rev 2054)
+++ MacRuby/branches/experimental/io.c	2009-07-23 00:06:31 UTC (rev 2055)
@@ -4446,15 +4446,18 @@
     rb_objc_define_method(rb_cIO, "set_encoding", rb_io_set_encoding, -1);
 
     rb_stdin = prep_io(fileno(stdin), FMODE_READABLE, rb_cIO, false);
+    GC_WB(&(ExtractIOStruct(rb_stdin)->path), CFSTR("<STDIN>"));
     rb_define_variable("$stdin", &rb_stdin);
     rb_define_global_const("STDIN", rb_stdin);
     
     rb_stdout = prep_io(fileno(stdout), FMODE_WRITABLE, rb_cIO, false);
+    GC_WB(&(ExtractIOStruct(rb_stdout)->path), CFSTR("<STDOUT>"));
     rb_define_hooked_variable("$stdout", &rb_stdout, 0, stdout_setter);
     rb_define_hooked_variable("$>", &rb_stdout, 0, stdout_setter);
     rb_define_global_const("STDOUT", rb_stdout);
     
     rb_stderr = prep_io(fileno(stderr), FMODE_WRITABLE|FMODE_SYNC, rb_cIO, false);
+    GC_WB(&(ExtractIOStruct(rb_stderr)->path), CFSTR("<STDERR>"));
     rb_define_hooked_variable("$stderr", &rb_stderr, 0, stdout_setter);
     rb_define_global_const("STDERR", rb_stderr);
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090722/914a5ac9/attachment.html>


More information about the macruby-changes mailing list