ruby-changes:8337
From: nobu <ko1@a...>
Date: Tue, 21 Oct 2008 10:40:56 +0900 (JST)
Subject: [ruby-changes:8337] Ruby:r19865 (trunk): * io.c (rb_file_open_internal): should initialize fmode before using.
nobu 2008-10-21 10:40:41 +0900 (Tue, 21 Oct 2008) New Revision: 19865 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19865 Log: * io.c (rb_file_open_internal): should initialize fmode before using. Modified files: trunk/ChangeLog trunk/io.c Index: ChangeLog =================================================================== --- ChangeLog (revision 19864) +++ ChangeLog (revision 19865) @@ -1,3 +1,7 @@ +Tue Oct 21 10:40:37 2008 Nobuyoshi Nakada <nobu@r...> + + * io.c (rb_file_open_internal): should initialize fmode before using. + Tue Oct 21 08:56:37 2008 Nobuyoshi Nakada <nobu@r...> * regparse.c (parse_char_class): CCV_SB is only for single Index: io.c =================================================================== --- io.c (revision 19864) +++ io.c (revision 19865) @@ -4150,10 +4150,10 @@ 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 @@ convconfig.ecopts = Qnil; } - fmode = rb_io_modestr_fmode(modestr); return rb_file_open_generic(io, filename, rb_io_fmode_oflags(fmode), fmode, -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/