about summary refs log tree commit diff
path: root/libio/genops.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/genops.c')
-rw-r--r--libio/genops.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/libio/genops.c b/libio/genops.c
index ad6c7f7ea4..f68912ceb4 100644
--- a/libio/genops.c
+++ b/libio/genops.c
@@ -881,12 +881,18 @@ _IO_unbuffer_write ()
 {
   struct _IO_FILE *fp;
   for (fp = (_IO_FILE *) _IO_list_all; fp; fp = fp->_chain)
-    if (! (fp->_flags & _IO_UNBUFFERED)
-	&& (! (fp->_flags & _IO_NO_WRITES)
-	    || (fp->_flags & _IO_IS_APPENDING))
-	/* Iff stream is un-orientated, it wasn't used. */
-	&& fp->_mode != 0)
-      _IO_SETBUF (fp, NULL, 0);
+    {
+      if (! (fp->_flags & _IO_UNBUFFERED)
+	  && (! (fp->_flags & _IO_NO_WRITES)
+	      || (fp->_flags & _IO_IS_APPENDING))
+	  /* Iff stream is un-orientated, it wasn't used. */
+	  && fp->_mode != 0)
+	_IO_SETBUF (fp, NULL, 0);
+
+      /* Make sure that never again the wide char functions can be
+	 used.  */
+      fp->_mode = -1;
+    }
 }
 
 int