diff --git a/ChangeLog b/ChangeLog index 5bbeccd082..500e66e806 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Dec 13 08:24:16 2007 Yukihiro Matsumoto + + * 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 * re.c, regerror.c, string.c, parse.y, ruby.c, file.c: diff --git a/io.c b/io.c index 5975296ac2..5af2d493c6 100644 --- a/io.c +++ b/io.c @@ -1266,6 +1266,16 @@ remain_size(rb_io_t *fptr) return (long)siz; } +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) { @@ -1291,9 +1301,7 @@ read_all(rb_io_t *fptr, long siz, VALUE str) 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 @@ rb_io_write_nonblock(VALUE io, VALUE str) 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 @@ io_read(int argc, VALUE *argv, VALUE io) return Qnil; } rb_str_resize(str, n); - return io_enc_str(str, fptr); + + return str; } static int diff --git a/version.h b/version.h index 9168e76ea0..027c64de08 100644 --- a/version.h +++ b/version.h @@ -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[];