summaryrefslogtreecommitdiff
path: root/libio/fileops.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-05-28 18:32:20 +0000
committerUlrich Drepper <drepper@redhat.com>2000-05-28 18:32:20 +0000
commit7163e69e10f3bbbe71a416d15e66eac16c852d27 (patch)
treef9f24400eca60cf5f6b49e92fb8e6b62a8b3195b /libio/fileops.c
parent1ef9f0b673cc36f307161d653d4305dee8da00f9 (diff)
downloadglibc-7163e69e10f3bbbe71a416d15e66eac16c852d27.tar.gz
Update.
2000-05-21 Jakub Jelinek <jakub@redhat.com> * libio/libioP.h (_IO_CHECK_WIDE): Define. * libio/iosetbuffer.c (_IO_setbuffer): Use it. Call _IO_WSETBUF even for _mode 1. * libio/iosetvbuf.c (_IO_setvbuf): Likewise. * libio/fileops.c (_IO_new_file_fopen): Return NULL if _IO_CHECK_WIDE fails.
Diffstat (limited to 'libio/fileops.c')
-rw-r--r--libio/fileops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libio/fileops.c b/libio/fileops.c
index c5aea3a60e..cd57370d98 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -278,9 +278,9 @@ _IO_new_file_fopen (fp, filename, mode, is32not64)
/* Yep. Load the appropriate conversions and set the orientation
to wide. */
struct gconv_fcts fcts;
- struct _IO_codecvt *cc = &fp->_wide_data->_codecvt;
+ struct _IO_codecvt *cc;
- if (__wcsmbs_named_conv (&fcts, cs + 5) != 0)
+ if (! _IO_CHECK_WIDE (fp) || __wcsmbs_named_conv (&fcts, cs + 5) != 0)
{
/* Something went wrong, we cannot load the conversion modules.
This means we cannot proceed since the user explicitly asked
@@ -289,6 +289,8 @@ _IO_new_file_fopen (fp, filename, mode, is32not64)
return NULL;
}
+ cc = &fp->_wide_data->_codecvt;
+
/* The functions are always the same. */
*cc = __libio_codecvt;