summaryrefslogtreecommitdiff
path: root/libio
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-24 04:57:22 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-24 04:57:22 +0000
commitca1324fe652dc5b971e73ae64e93d23415c35066 (patch)
tree0c627ad4feac7d2c50762bfd4f18677a3ecfc65c /libio
parentb72b8877d89a15cc40c34b008e3d62ac24e43d7e (diff)
downloadgcc-ca1324fe652dc5b971e73ae64e93d23415c35066.tar.gz
* iostream.cc (endl): Verify stream can accept characters
before writing its eol. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34122 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libio')
-rw-r--r--libio/ChangeLog5
-rw-r--r--libio/iostream.cc4
2 files changed, 8 insertions, 1 deletions
diff --git a/libio/ChangeLog b/libio/ChangeLog
index fdbdf06dd0e..8735e8f1468 100644
--- a/libio/ChangeLog
+++ b/libio/ChangeLog
@@ -1,3 +1,8 @@
+Tue May 23 22:56:56 2000 Jerry Quinn
+
+ * iostream.cc (endl): Verify stream can accept characters
+ before writing its eol.
+
2000-05-15 David Edelsohn <edelsohn@gnu.org>
* config.shared: Change "pic" to depend on $(PICFLAG), not
diff --git a/libio/iostream.cc b/libio/iostream.cc
index 4b75fca764d..cabda6bfede 100644
--- a/libio/iostream.cc
+++ b/libio/iostream.cc
@@ -963,7 +963,9 @@ ostream& ends(ostream& outs)
ostream& endl(ostream& outs)
{
- return flush(outs.put('\n'));
+ if (opfx)
+ flush(outs.put('\n'));
+ return outs;
}
istream& lock(istream& ins)