[前][次][番号順一覧][スレッド一覧]

ruby-changes:7616

From: akr <ko1@a...>
Date: Thu, 4 Sep 2008 23:44:07 +0900 (JST)
Subject: [ruby-changes:7616] Ruby:r19137 (trunk): * include/ruby/intern.h (rb_file_open_str): declared.

akr	2008-09-04 23:43:45 +0900 (Thu, 04 Sep 2008)

  New Revision: 19137

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19137

  Log:
    * include/ruby/intern.h (rb_file_open_str): declared.
    
    * io.c (rb_file_open_str): defined.
    
    * ext/zlib/zlib.c (gzfile_s_open): use rb_file_open_str instead of
      rb_file_open.

  Modified files:
    trunk/ChangeLog
    trunk/ext/zlib/zlib.c
    trunk/include/ruby/intern.h
    trunk/io.c

Index: include/ruby/intern.h
===================================================================
--- include/ruby/intern.h	(revision 19136)
+++ include/ruby/intern.h	(revision 19137)
@@ -387,6 +387,7 @@
 VALUE rb_io_puts(int, VALUE*, VALUE);
 VALUE rb_io_fdopen(int, int, const char*);
 VALUE rb_file_open(const char*, const char*);
+VALUE rb_file_open_str(VALUE, const char*);
 VALUE rb_gets(void);
 void rb_write_error(const char*);
 void rb_write_error2(const char*, long);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 19136)
+++ ChangeLog	(revision 19137)
@@ -1,3 +1,12 @@
+Thu Sep  4 23:42:42 2008  Tanaka Akira  <akr@f...>
+
+	* include/ruby/intern.h (rb_file_open_str): declared.
+
+	* io.c (rb_file_open_str): defined.
+
+	* ext/zlib/zlib.c (gzfile_s_open): use rb_file_open_str instead of
+	  rb_file_open.
+
 Thu Sep  4 23:18:55 2008  Tanaka Akira  <akr@f...>
 
 	* enc/trans/newline.trans: record newline types met in universal
Index: io.c
===================================================================
--- io.c	(revision 19136)
+++ io.c	(revision 19137)
@@ -4051,6 +4051,12 @@
 }
 
 VALUE
+rb_file_open_str(VALUE fname, const char *mode)
+{
+    return rb_file_open_internal(io_alloc(rb_cFile), fname, mode);
+}
+
+VALUE
 rb_file_open(const char *fname, const char *mode)
 {
     return rb_file_open_internal(io_alloc(rb_cFile), rb_str_new_cstr(fname), mode);
Index: ext/zlib/zlib.c
===================================================================
--- ext/zlib/zlib.c	(revision 19136)
+++ ext/zlib/zlib.c	(revision 19137)
@@ -2294,7 +2294,7 @@
     }
     filename = argv[0];
     FilePathValue(filename);
-    io = rb_file_open(RSTRING_PTR(filename), mode);
+    io = rb_file_open_str(filename, mode);
 
     argv[0] = io;
     return rb_gzfile_s_wrap(argc, argv, klass);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]