Skip to content

Commit 0ca7036

Browse files
author
matz
committed
* io.c (read_all): should associate default external encoding.
* io.c (io_read): should NOT associate default external encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent b92cee1 commit 0ca7036

File tree

3 files changed

+22
-17
lines changed

3 files changed

+22
-17
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Thu Dec 13 08:24:16 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
2+
3+
* io.c (read_all): should associate default external encoding.
4+
5+
* io.c (io_read): should NOT associate default external encoding.
6+
17
Wed Dec 12 23:22:58 2007 Tanaka Akira <akr@fsij.org>
28

39
* re.c, regerror.c, string.c, parse.y, ruby.c, file.c:

io.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,6 +1266,16 @@ remain_size(rb_io_t *fptr)
12661266
return (long)siz;
12671267
}
12681268

1269+
static VALUE
1270+
io_enc_str(VALUE str, rb_io_t *fptr)
1271+
{
1272+
OBJ_TAINT(str);
1273+
if (fptr->enc) {
1274+
rb_enc_associate(str, fptr->enc);
1275+
}
1276+
return str;
1277+
}
1278+
12691279
static VALUE
12701280
read_all(rb_io_t *fptr, long siz, VALUE str)
12711281
{
@@ -1291,9 +1301,7 @@ read_all(rb_io_t *fptr, long siz, VALUE str)
12911301
rb_str_resize(str, siz);
12921302
}
12931303
if (bytes != siz) rb_str_resize(str, bytes);
1294-
OBJ_TAINT(str);
1295-
1296-
return str;
1304+
return io_enc_str(str, fptr);
12971305
}
12981306

12991307
void rb_io_set_nonblock(rb_io_t *fptr)
@@ -1521,16 +1529,6 @@ rb_io_write_nonblock(VALUE io, VALUE str)
15211529
return LONG2FIX(n);
15221530
}
15231531

1524-
static VALUE
1525-
io_enc_str(VALUE str, rb_io_t *fptr)
1526-
{
1527-
OBJ_TAINT(str);
1528-
if (fptr->enc) {
1529-
rb_enc_associate(str, fptr->enc);
1530-
}
1531-
return str;
1532-
}
1533-
15341532
/*
15351533
* call-seq:
15361534
* ios.read([length [, buffer]]) => string, buffer, or nil
@@ -1597,7 +1595,8 @@ io_read(int argc, VALUE *argv, VALUE io)
15971595
return Qnil;
15981596
}
15991597
rb_str_resize(str, n);
1600-
return io_enc_str(str, fptr);
1598+
1599+
return str;
16011600
}
16021601

16031602
static int

version.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#define RUBY_VERSION "1.9.0"
2-
#define RUBY_RELEASE_DATE "2007-12-12"
2+
#define RUBY_RELEASE_DATE "2007-12-13"
33
#define RUBY_VERSION_CODE 190
4-
#define RUBY_RELEASE_CODE 20071212
4+
#define RUBY_RELEASE_CODE 20071213
55
#define RUBY_PATCHLEVEL 0
66

77
#define RUBY_VERSION_MAJOR 1
88
#define RUBY_VERSION_MINOR 9
99
#define RUBY_VERSION_TEENY 0
1010
#define RUBY_RELEASE_YEAR 2007
1111
#define RUBY_RELEASE_MONTH 12
12-
#define RUBY_RELEASE_DAY 12
12+
#define RUBY_RELEASE_DAY 13
1313

1414
#ifdef RUBY_EXTERN
1515
RUBY_EXTERN const char ruby_version[];

0 commit comments

Comments
 (0)