ruby-changes:2712
From: ko1@a...
Date: 13 Dec 2007 08:47:47 +0900
Subject: [ruby-changes:2712] matz - Ruby:r14203 (trunk): * io.c (read_all): should associate default external encoding.
matz 2007-12-13 08:46:58 +0900 (Thu, 13 Dec 2007) New Revision: 14203 Modified files: trunk/ChangeLog trunk/io.c trunk/version.h Log: * io.c (read_all): should associate default external encoding. * io.c (io_read): should NOT associate default external encoding. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/version.h?r1=14203&r2=14202 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14203&r2=14202 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/io.c?r1=14203&r2=14202 Index: ChangeLog =================================================================== --- ChangeLog (revision 14202) +++ ChangeLog (revision 14203) @@ -1,3 +1,9 @@ +Thu Dec 13 08:24:16 2007 Yukihiro Matsumoto <matz@r...> + + * io.c (read_all): should associate default external encoding. + + * io.c (io_read): should NOT associate default external encoding. + Wed Dec 12 23:22:58 2007 Tanaka Akira <akr@f...> * re.c, regerror.c, string.c, parse.y, ruby.c, file.c: Index: io.c =================================================================== --- io.c (revision 14202) +++ io.c (revision 14203) @@ -1267,6 +1267,16 @@ } static VALUE +io_enc_str(VALUE str, rb_io_t *fptr) +{ + OBJ_TAINT(str); + if (fptr->enc) { + rb_enc_associate(str, fptr->enc); + } + return str; +} + +static VALUE read_all(rb_io_t *fptr, long siz, VALUE str) { long bytes = 0; @@ -1291,9 +1301,7 @@ rb_str_resize(str, siz); } if (bytes != siz) rb_str_resize(str, bytes); - OBJ_TAINT(str); - - return str; + return io_enc_str(str, fptr); } void rb_io_set_nonblock(rb_io_t *fptr) @@ -1521,16 +1529,6 @@ return LONG2FIX(n); } -static VALUE -io_enc_str(VALUE str, rb_io_t *fptr) -{ - OBJ_TAINT(str); - if (fptr->enc) { - rb_enc_associate(str, fptr->enc); - } - return str; -} - /* * call-seq: * ios.read([length [, buffer]]) => string, buffer, or nil @@ -1597,7 +1595,8 @@ return Qnil; } rb_str_resize(str, n); - return io_enc_str(str, fptr); + + return str; } static int Index: version.h =================================================================== --- version.h (revision 14202) +++ version.h (revision 14203) @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.0" -#define RUBY_RELEASE_DATE "2007-12-12" +#define RUBY_RELEASE_DATE "2007-12-13" #define RUBY_VERSION_CODE 190 -#define RUBY_RELEASE_CODE 20071212 +#define RUBY_RELEASE_CODE 20071213 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2007 #define RUBY_RELEASE_MONTH 12 -#define RUBY_RELEASE_DAY 12 +#define RUBY_RELEASE_DAY 13 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml