зеркало из https://github.com/github/ruby.git
* io.c (rb_io_s_pipe): potential bug. the mode of read IO is set as
DEFAULT_TEXTMODE in call of io_set_encoding(), and of write IO is also set as it in call of io_new_instance() via rb_protect(). so, if DEFAULT_TEXTMODE is not 0, we should check the result of extract_binmode() and avoid crush of default IO mode and the result. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
8fa30bbd48
Коммит
da1db8b454
|
@ -1,3 +1,11 @@
|
|||
Tue May 31 14:17:49 2011 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* io.c (rb_io_s_pipe): potential bug. the mode of read IO is set as
|
||||
DEFAULT_TEXTMODE in call of io_set_encoding(), and of write IO is
|
||||
also set as it in call of io_new_instance() via rb_protect().
|
||||
so, if DEFAULT_TEXTMODE is not 0, we should check the result of
|
||||
extract_binmode() and avoid crush of default IO mode and the result.
|
||||
|
||||
Tue May 31 13:00:17 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||
|
||||
* strftime.c (rb_strftime_with_timespec): improved style consistency.
|
||||
|
|
8
io.c
8
io.c
|
@ -8115,7 +8115,15 @@ rb_io_s_pipe(int argc, VALUE *argv, VALUE klass)
|
|||
rb_io_synchronized(fptr2);
|
||||
|
||||
extract_binmode(opt, &fmode);
|
||||
#if DEFAULT_TEXTMODE
|
||||
if ((fptr->mode & FMODE_TEXTMODE) && (fmode & FMODE_BINMODE))
|
||||
fptr->mode &= ~FMODE_TEXTMODE;
|
||||
#endif
|
||||
fptr->mode |= fmode;
|
||||
#if DEFAULT_TEXTMODE
|
||||
if ((fptr2->mode & FMODE_TEXTMODE) && (fmode & FMODE_BINMODE))
|
||||
fptr2->mode &= ~FMODE_TEXTMODE;
|
||||
#endif
|
||||
fptr2->mode |= fmode;
|
||||
|
||||
ret = rb_assoc_new(r, w);
|
||||
|
|
Загрузка…
Ссылка в новой задаче