aboutsummaryrefslogtreecommitdiff
path: root/libio
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-07-24 21:03:16 +0000
committerUlrich Drepper <drepper@redhat.com>2000-07-24 21:03:16 +0000
commit5bef282098d6c920c12e46dea5bac099e5cb3abf (patch)
treea8eadab44e26951b9bf0abdcfc964afbe06cdbc1 /libio
parentf3d5834e69eeb4dca353ef35c600adb74d604f22 (diff)
downloadglibc-5bef282098d6c920c12e46dea5bac099e5cb3abf.zip
glibc-5bef282098d6c920c12e46dea5bac099e5cb3abf.tar.gz
glibc-5bef282098d6c920c12e46dea5bac099e5cb3abf.tar.bz2
Update.
2000-07-24 Jakub Jelinek <jakub@redhat.com> * libio/wfiledoalloc.c (_IO_wfile_doallocate): Measure size in wide characters, not bytes. * libio/tst_putwc.c (do_test): Add test for writing lots of data into file. 2000-07-22 Bruno Haible <haible@clisp.cons.org> * locale/nl_langinfo.c (nl_langinfo): Accept items belonging to the new categories LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEASUREMENT, LC_IDENTIFICATION. * locale/xlocale.h (struct __locale_struct): Increase size of __locales array. * locale/duplocale.c (__duplocale): Copy newly added categories as well. * locale/freelocale.c (__freelocale): Free newly added categories. * locale/newlocale.c (__newlocale): Fix typo in sanity check. If a base is given, use it, don't simply return it. 2000-07-22 Bruno Haible <haible@clisp.cons.org> * crypt/md5-crypt.c (__md5_crypt_r): Avoid gcc warnings: Use pointer variables, copied_key and copied_salt, instead of boolean variables.
Diffstat (limited to 'libio')
-rw-r--r--libio/tst_putwc.c10
-rw-r--r--libio/wfiledoalloc.c9
2 files changed, 14 insertions, 5 deletions
diff --git a/libio/tst_putwc.c b/libio/tst_putwc.c
index 142b3bc..60bb232 100644
--- a/libio/tst_putwc.c
+++ b/libio/tst_putwc.c
@@ -101,6 +101,16 @@ do_test (void)
res = 1;
}
+ /* Next test: write a bit more than a few bytes. */
+ fp = fopen (outname, "w");
+ if (fp == NULL)
+ error (EXIT_FAILURE, errno, "cannot open temporary file");
+
+ for (n = 0; n < 4098; ++n)
+ putwc (n & 255, fp);
+
+ fclose (fp);
+
return res;
}
diff --git a/libio/wfiledoalloc.c b/libio/wfiledoalloc.c
index 76226e9..4e4ca67 100644
--- a/libio/wfiledoalloc.c
+++ b/libio/wfiledoalloc.c
@@ -82,7 +82,7 @@ _IO_wfile_doallocate (fp)
if (fp->_fileno < 0 || _IO_SYSSTAT (fp, &st) < 0)
{
couldbetty = 0;
- size = _IO_BUFSIZ * sizeof (wchar_t);
+ size = _IO_BUFSIZ;
#if 0
/* do not try to optimise fseek() */
fp->_flags |= __SNPT;
@@ -92,13 +92,12 @@ _IO_wfile_doallocate (fp)
{
couldbetty = S_ISCHR (st.st_mode);
#if _IO_HAVE_ST_BLKSIZE
- size = ((st.st_blksize <= 0 ? _IO_BUFSIZ : st.st_blksize)
- * sizeof (wchar_t));
+ size = st.st_blksize <= 0 ? _IO_BUFSIZ : st.st_blksize;
#else
- size = _IO_BUFSIZ * sizeof (wchar_t);
+ size = _IO_BUFSIZ;
#endif
}
- ALLOC_WBUF (p, size, EOF);
+ ALLOC_WBUF (p, size * sizeof (wchar_t), EOF);
_IO_wsetb (fp, p, p + size, 1);
if (couldbetty && isatty (fp->_fileno))
fp->_flags |= _IO_LINE_BUF;