summary refs log tree commit diff
path: root/libio/iosetvbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/iosetvbuf.c')
-rw-r--r--libio/iosetvbuf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libio/iosetvbuf.c b/libio/iosetvbuf.c
index 02f4eefb5e..b9ef31a278 100644
--- a/libio/iosetvbuf.c
+++ b/libio/iosetvbuf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
 
    This library is free software; you can redistribute it and/or
@@ -90,6 +90,10 @@ _IO_setvbuf (fp, buf, mode, size)
       goto unlock_return;
     }
   result = _IO_SETBUF (fp, buf, size) == NULL ? EOF : 0;
+  if (result == 0 && fp->_mode > 0)
+    /* We also have to set the buffer using the wide char function.  */
+    result = ((*fp->_wide_data->_wide_vtable->__setbuf) (fp, buf, size) == NULL
+	      ? EOF : 0);
 unlock_return:
   _IO_funlockfile (fp);
   _IO_cleanup_region_end (0);