1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* io.c (rb_io_extract_modeenc, rb_f_backquote): set default text

mode.  fixes #4619
* io.c (pipe_open): set universal newline decorator if needed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-04-27 21:06:59 +00:00
parent 06911f90ce
commit 9c48e59907
2 changed files with 12 additions and 2 deletions

View file

@ -1,3 +1,10 @@
Thu Apr 28 06:06:56 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (rb_io_extract_modeenc, rb_f_backquote): set default text
mode. fixes #4619
* io.c (pipe_open): set universal newline decorator if needed.
Wed Apr 27 11:33:08 2011 NARUSE, Yui <naruse@ruby-lang.org>
* enc/trans/emoji_iso2022_kddi.trans: ISO-2022-JP-KDDI doesn't have

7
io.c
View file

@ -4496,7 +4496,7 @@ rb_io_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash,
rb_io_ext_int_to_encs(NULL, NULL, &enc, &enc2);
if (NIL_P(vmode)) {
fmode = FMODE_READABLE;
fmode = FMODE_READABLE | DEFAULT_TEXTMODE;
oflags = O_RDONLY;
}
else if (!NIL_P(intmode = rb_check_to_integer(vmode, "to_int"))) {
@ -5249,6 +5249,9 @@ pipe_open(struct rb_exec_arg *eargp, VALUE prog, const char *modestr, int fmode,
if (convconfig) {
fptr->encs = *convconfig;
}
else if (NEED_NEWLINE_DECORATOR_ON_READ(fptr)) {
fptr->encs.ecflags |= ECONV_UNIVERSAL_NEWLINE_DECORATOR;
}
fptr->pid = pid;
if (0 <= write_fd) {
@ -7248,7 +7251,7 @@ rb_f_backquote(VALUE obj, VALUE str)
rb_io_t *fptr;
SafeStringValue(str);
port = pipe_open_s(str, "r", FMODE_READABLE, NULL);
port = pipe_open_s(str, "r", FMODE_READABLE|DEFAULT_TEXTMODE, NULL);
if (NIL_P(port)) return rb_str_new(0,0);
GetOpenFile(port, fptr);