aboutsummaryrefslogtreecommitdiff
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
parent1ef9f0b673cc36f307161d653d4305dee8da00f9 (diff)
downloadglibc-7163e69e10f3bbbe71a416d15e66eac16c852d27.tar
glibc-7163e69e10f3bbbe71a416d15e66eac16c852d27.tar.gz
glibc-7163e69e10f3bbbe71a416d15e66eac16c852d27.tar.bz2
glibc-7163e69e10f3bbbe71a416d15e66eac16c852d27.zip
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.
-rw-r--r--ChangeLog9
-rw-r--r--libio/bits/stdio.h2
-rw-r--r--libio/fileops.c6
-rw-r--r--libio/iosetbuffer.c6
-rw-r--r--libio/iosetvbuf.c7
-rw-r--r--libio/libioP.h2
6 files changed, 23 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 3ed8ffa010..2885dd71e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+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.
+
2000-05-28 Ulrich Drepper <drepper@redhat.com>
* po/da.po: New file.
diff --git a/libio/bits/stdio.h b/libio/bits/stdio.h
index d698132558..2522a3846e 100644
--- a/libio/bits/stdio.h
+++ b/libio/bits/stdio.h
@@ -1,5 +1,5 @@
/* Optimizing macros and inline functions for stdio functions.
- Copyright (C) 198 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
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;
diff --git a/libio/iosetbuffer.c b/libio/iosetbuffer.c
index 852a2dd36c..99738a7faf 100644
--- a/libio/iosetbuffer.c
+++ b/libio/iosetbuffer.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -32,13 +32,13 @@ _IO_setbuffer (fp, buf, size)
_IO_size_t size;
{
CHECK_FILE (fp, );
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
+ _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, fp);
_IO_flockfile (fp);
fp->_flags &= ~_IO_LINE_BUF;
if (!buf)
size = 0;
(void) _IO_SETBUF (fp, buf, size);
- if (fp->_vtable_offset == 0 && fp->_mode == 0)
+ if (fp->_vtable_offset == 0 && fp->_mode == 0 && _IO_CHECK_WIDE (fp))
/* We also have to set the buffer using the wide char function. */
(void) _IO_WSETBUF (fp, buf, size);
_IO_funlockfile (fp);
diff --git a/libio/iosetvbuf.c b/libio/iosetvbuf.c
index a0287a3ee5..673677191a 100644
--- a/libio/iosetvbuf.c
+++ b/libio/iosetvbuf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -38,7 +38,7 @@ _IO_setvbuf (fp, buf, mode, size)
{
int result;
CHECK_FILE (fp, EOF);
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
+ _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, fp);
_IO_flockfile (fp);
switch (mode)
{
@@ -90,7 +90,8 @@ _IO_setvbuf (fp, buf, mode, size)
goto unlock_return;
}
result = _IO_SETBUF (fp, buf, size) == NULL ? EOF : 0;
- if (result == 0 && fp->_vtable_offset == 0 && fp->_mode == 0)
+ if (result == 0 && fp->_vtable_offset == 0 && fp->_mode == 0
+ && _IO_CHECK_WIDE (fp))
/* We also have to set the buffer using the wide char function. */
result = _IO_WSETBUF (fp, buf, size) == NULL ? EOF : 0;
diff --git a/libio/libioP.h b/libio/libioP.h
index d23436ab26..59d20cd4be 100644
--- a/libio/libioP.h
+++ b/libio/libioP.h
@@ -71,6 +71,8 @@ extern "C" {
#define _IO_JUMPS(THIS) ((struct _IO_FILE_plus *) (THIS))->vtable
#define _IO_WIDE_JUMPS(THIS) ((struct _IO_FILE *) (THIS))->_wide_data->_wide_vtable
+#define _IO_CHECK_WIDE(THIS) (((struct _IO_FILE *) (THIS))->_wide_data != NULL)
+
#if _IO_JUMPS_OFFSET
# define _IO_JUMPS_FUNC(THIS) \
(*(struct _IO_jump_t **) ((void *) &((struct _IO_FILE_plus *) (THIS))->vtable\