1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
2006-12-13  Ulrich Drepper  <drepper@redhat.com>
	[BZ #2337]
	* libio/Makefile (tests): Add tst-setvbuf1.
	* libio/tst-setvbuf1.c: New file.

2006-12-08  Jakub Jelinek  <jakub@redhat.com>

	[BZ #2337]
	* libio/genops.c (__uflow): Fix a typo.
	* libio/wfiledoalloc.c (_IO_wfile_doallocate): Don't stat
	nor set _IO_LINE_BUF bit here.  Size the wide buffer based on
	the narrow buffer size.

2006-11-24  Jakub Jelinek  <jakub@redhat.com>

	[BZ #2337]
	* libio/libio.h (_IO_FLAGS2_USER_WBUF): Define.
	* libio/wgenops.c (_IO_wsetb, _IO_wdefault_finish): Test and set
	_IO_FLAGS2_USER_WBUF bit in _flags2 instead of _IO_USER_BUF bit
	in _flags.
	* libio/wstrops.c (_IO_wstr_overflow, enlarge_userbuf,
	_IO_wstr_finish): Likewise.
	* libio/wmemstream.c (open_wmemstream): Likewise.
	* libio/fileops.c (_IO_new_file_close_it): Call _IO_set[bgp]
	even for wide streams.
This commit is contained in:
Ulrich Drepper
2006-12-13 23:17:54 +00:00
parent f72386ad7c
commit 1e88bd0f1b
10 changed files with 91 additions and 40 deletions

View File

@ -88,7 +88,7 @@ _IO_wstr_overflow (fp, c)
pos = fp->_wide_data->_IO_write_ptr - fp->_wide_data->_IO_write_base;
if (pos >= (_IO_size_t) (_IO_wblen (fp) + flush_only))
{
if (fp->_flags & _IO_USER_BUF) /* not allowed to enlarge */
if (fp->_flags2 & _IO_FLAGS2_USER_WBUF) /* not allowed to enlarge */
return WEOF;
else
{
@ -182,7 +182,7 @@ enlarge_userbuf (_IO_FILE *fp, _IO_off64_t offset, int reading)
_IO_ssize_t oldend = wd->_IO_write_end - wd->_IO_write_base;
/* Try to enlarge the buffer. */
if (fp->_flags & _IO_USER_BUF)
if (fp->_flags2 & _IO_FLAGS2_USER_WBUF)
/* User-provided buffer. */
return 1;
@ -335,7 +335,7 @@ _IO_wstr_finish (fp, dummy)
_IO_FILE *fp;
int dummy;
{
if (fp->_wide_data->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
if (fp->_wide_data->_IO_buf_base && !(fp->_flags2 & _IO_FLAGS2_USER_WBUF))
(((_IO_strfile *) fp)->_s._free_buffer) (fp->_wide_data->_IO_buf_base);
fp->_wide_data->_IO_buf_base = NULL;