From d765a38bf5cc8101bd4a337860367a2981cb7683 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 17 Jan 2008 22:20:20 +0000 Subject: [PATCH] * io.c (io_fwrite): always flush IO on tty, even without newlines. [ruby-core:15107] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ io.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index dc5ab71ce7..afe340b179 100644 --- a/ChangeLog +++ b/ChangeLog @@ -63,6 +63,11 @@ Thu Jan 17 21:01:25 2008 Tadayoshi Funaba * lib/date.rb, lib/date/format.rb: some trivial changes. +Thu Jan 17 10:30:32 2008 Yukihiro Matsumoto + + * io.c (io_fwrite): always flush IO on tty, even without newlines. + [ruby-core:15107] + Wed Jan 16 22:45:27 2008 Nobuyoshi Nakada * encoding.c (enc_register_at): make own copy. [ruby-dev:33136] diff --git a/io.c b/io.c index 12295c8ff7..734799a83a 100644 --- a/io.c +++ b/io.c @@ -693,7 +693,7 @@ io_fwrite(VALUE str, rb_io_t *fptr) } if ((fptr->mode & FMODE_SYNC) || (fptr->wbuf && fptr->wbuf_capa <= fptr->wbuf_len + len) || - ((fptr->mode & FMODE_TTY) && memchr(RSTRING_PTR(str)+offset, '\n', len))) { + (fptr->mode & FMODE_TTY)) { /* xxx: use writev to avoid double write if available */ if (fptr->wbuf_len && fptr->wbuf_len+len <= fptr->wbuf_capa) { if (fptr->wbuf_capa < fptr->wbuf_off+fptr->wbuf_len+len) {