* iostream.cc (endl): Verify stream can accept characters
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 24 May 2000 04:57:22 +0000 (04:57 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 24 May 2000 04:57:22 +0000 (04:57 +0000)
        before writing its eol.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34122 138bc75d-0d04-0410-961f-82ee72b054a4

libio/ChangeLog
libio/iostream.cc

index fdbdf06..8735e8f 100644 (file)
@@ -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
index 4b75fca..cabda6b 100644 (file)
@@ -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)