iostream.cc (endl): Verify stream can accept characters before writing its eol.
authorJeff Law <law@gcc.gnu.org>
Wed, 24 May 2000 04:57:22 +0000 (22:57 -0600)
committerJeff Law <law@gcc.gnu.org>
Wed, 24 May 2000 04:57:22 +0000 (22:57 -0600)
        * iostream.cc (endl): Verify stream can accept characters
        before writing its eol.

From-SVN: r34122

libio/ChangeLog
libio/iostream.cc

index fdbdf06dd0e9db398197a58f8dd50940e1bc7dcb..8735e8f1468ade0c83a7b53e784e51e1253e7f4b 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 4b75fca764dd25782addb95b64fcc16b5ebca23d..cabda6bfede1ac0953f945a2c4b7016c675240cf 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)