summary refs log tree commit diff
path: root/libio
diff options
context:
space:
mode:
Diffstat (limited to 'libio')
-rw-r--r--libio/genops.c4
-rw-r--r--libio/iofputs.c2
-rw-r--r--libio/ioftell.c2
-rw-r--r--libio/iofwrite.c2
-rw-r--r--libio/ioputs.c2
-rw-r--r--libio/iosetbuffer.c2
-rw-r--r--libio/iosetvbuf.c2
7 files changed, 8 insertions, 8 deletions
diff --git a/libio/genops.c b/libio/genops.c
index 07dc4e81dd..a8fce5fa77 100644
--- a/libio/genops.c
+++ b/libio/genops.c
@@ -282,7 +282,7 @@ int
 __underflow (fp)
      _IO_FILE *fp;
 {
-  if (_IO_fwide (fp, -1) != -1)
+  if (fp->_vtable_offset == 0 && _IO_fwide (fp, -1) != -1)
     return EOF;
 
   if (_IO_in_put_mode (fp))
@@ -310,7 +310,7 @@ int
 __uflow (fp)
      _IO_FILE *fp;
 {
-  if (_IO_fwide (fp, -1) != -1)
+  if (fp->_vtable_offset == 0 && _IO_fwide (fp, -1) != -1)
     return EOF;
 
   if (_IO_in_put_mode (fp))
diff --git a/libio/iofputs.c b/libio/iofputs.c
index 32acf987a5..5b0553f327 100644
--- a/libio/iofputs.c
+++ b/libio/iofputs.c
@@ -36,7 +36,7 @@ _IO_fputs (str, fp)
   CHECK_FILE (fp, EOF);
   _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
   _IO_flockfile (fp);
-  if (_IO_fwide (fp, -1) == -1
+  if ((fp->_vtable_offset != 0 || _IO_fwide (fp, -1) == -1)
       && _IO_sputn (fp, str, len) == len)
     result = 1;
   _IO_funlockfile (fp);
diff --git a/libio/ioftell.c b/libio/ioftell.c
index 1f25b66c2b..38cb2f3369 100644
--- a/libio/ioftell.c
+++ b/libio/ioftell.c
@@ -38,7 +38,7 @@ _IO_ftell (fp)
   pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0);
   if (_IO_in_backup (fp))
     {
-      if (fp->_mode < 0)
+      if (fp->_vtable_offset != 0 || fp->_mode < 0)
 	pos -= fp->_IO_save_end - fp->_IO_save_base;
       else
 	/* XXX For now.  */
diff --git a/libio/iofwrite.c b/libio/iofwrite.c
index 9be18bd8e0..411eeb29a9 100644
--- a/libio/iofwrite.c
+++ b/libio/iofwrite.c
@@ -41,7 +41,7 @@ _IO_fwrite (buf, size, count, fp)
     return count;
   _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
   _IO_flockfile (fp);
-  if (_IO_fwide (fp, -1) == -1)
+  if (fp->_vtable_offset != 0 || _IO_fwide (fp, -1) == -1)
     written = _IO_sputn (fp, (const char *) buf, request);
   _IO_funlockfile (fp);
   _IO_cleanup_region_end (0);
diff --git a/libio/ioputs.c b/libio/ioputs.c
index 954b0f294f..86ae790718 100644
--- a/libio/ioputs.c
+++ b/libio/ioputs.c
@@ -36,7 +36,7 @@ _IO_puts (str)
 			    _IO_stdout);
   _IO_flockfile (_IO_stdout);
 
-  if (_IO_fwide (_IO_stdout, -1) == -1
+  if (_IO_stdout->_vtable_offset != 0 || _IO_fwide (_IO_stdout, -1) == -1)
       && _IO_sputn (_IO_stdout, str, len) == len
       && _IO_putc_unlocked ('\n', _IO_stdout) != EOF)
     result = len + 1;
diff --git a/libio/iosetbuffer.c b/libio/iosetbuffer.c
index d119cd0032..5acbf5e812 100644
--- a/libio/iosetbuffer.c
+++ b/libio/iosetbuffer.c
@@ -38,7 +38,7 @@ _IO_setbuffer (fp, buf, size)
   if (!buf)
     size = 0;
   (void) _IO_SETBUF (fp, buf, size);
-  if (fp->_mode == 0)
+  if (fp->_vtable_offset == 0 && fp->_mode == 0)
     /* We also have to set the buffer using the wide char function.  */
     (*fp->_wide_data->_wide_vtable->__setbuf) (fp, buf, size);
   _IO_funlockfile (fp);
diff --git a/libio/iosetvbuf.c b/libio/iosetvbuf.c
index 5dc5eedffe..f63a3c2174 100644
--- a/libio/iosetvbuf.c
+++ b/libio/iosetvbuf.c
@@ -90,7 +90,7 @@ _IO_setvbuf (fp, buf, mode, size)
       goto unlock_return;
     }
   result = _IO_SETBUF (fp, buf, size) == NULL ? EOF : 0;
-  if (result == 0 && fp->_mode == 0)
+  if (result == 0 && fp->_vtable_offset == 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);