aboutsummaryrefslogtreecommitdiff
path: root/libio/iostream.cc
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>2000-05-23 22:57:22 -0600
committerJeff Law <law@gcc.gnu.org>2000-05-23 22:57:22 -0600
commitdb9aed0ed672a0886f5c5aa7b0dde2209be9f827 (patch)
tree0c627ad4feac7d2c50762bfd4f18677a3ecfc65c /libio/iostream.cc
parent53e2d84900c96eee202ca7515641d3fb86ff29d7 (diff)
downloadgcc-db9aed0ed672a0886f5c5aa7b0dde2209be9f827.zip
gcc-db9aed0ed672a0886f5c5aa7b0dde2209be9f827.tar.gz
gcc-db9aed0ed672a0886f5c5aa7b0dde2209be9f827.tar.bz2
iostream.cc (endl): Verify stream can accept characters before writing its eol.
* iostream.cc (endl): Verify stream can accept characters before writing its eol. From-SVN: r34122
Diffstat (limited to 'libio/iostream.cc')
-rw-r--r--libio/iostream.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/libio/iostream.cc b/libio/iostream.cc
index 4b75fca..cabda6b 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)