1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-09-04 14:43:45 +00:00
parent 64b633f069
commit dac421a9c9
4 changed files with 17 additions and 1 deletions

View file

@ -1,3 +1,12 @@
Thu Sep 4 23:42:42 2008 Tanaka Akira <akr@fsij.org>
* 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@fsij.org>
* enc/trans/newline.trans: record newline types met in universal

View file

@ -2294,7 +2294,7 @@ gzfile_s_open(int argc, VALUE *argv, VALUE klass, const char *mode)
}
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);

View file

@ -387,6 +387,7 @@ VALUE rb_io_print(int, VALUE*, VALUE);
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);

6
io.c
View file

@ -4050,6 +4050,12 @@ rb_file_open_internal(VALUE io, VALUE filename, const char *mode)
0666);
}
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)
{