diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-21 01:40:41 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-21 01:40:41 +0000 |
| commit | 759211e2e28aeaf138b50caa1aa4570541091cb7 (patch) | |
| tree | 852270582c50b49d9f5ec6422dde54aab5eecaa1 | |
| parent | cd69280bbf3babb3e6392285fe74e59e93487dae (diff) | |
| download | ruby-759211e2e28aeaf138b50caa1aa4570541091cb7.tar.gz ruby-759211e2e28aeaf138b50caa1aa4570541091cb7.tar.xz ruby-759211e2e28aeaf138b50caa1aa4570541091cb7.zip | |
* io.c (rb_file_open_internal): should initialize fmode before using.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | io.c | 5 |
2 files changed, 6 insertions, 3 deletions
@@ -1,3 +1,7 @@ +Tue Oct 21 10:40:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * io.c (rb_file_open_internal): should initialize fmode before using. + Tue Oct 21 08:56:37 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> * regparse.c (parse_char_class): CCV_SB is only for single @@ -4150,10 +4150,10 @@ rb_file_open_generic(VALUE io, VALUE filename, int oflags, int fmode, convconfig static VALUE rb_file_open_internal(VALUE io, VALUE filename, const char *modestr) { - int fmode; - + int fmode = rb_io_modestr_fmode(modestr); const char *p = strchr(modestr, ':'); convconfig_t convconfig; + if (p) { parse_mode_enc(p+1, &convconfig.enc, &convconfig.enc2); } @@ -4167,7 +4167,6 @@ rb_file_open_internal(VALUE io, VALUE filename, const char *modestr) convconfig.ecopts = Qnil; } - fmode = rb_io_modestr_fmode(modestr); return rb_file_open_generic(io, filename, rb_io_fmode_oflags(fmode), fmode, |
