+2000-08-29 Ulrich Drepper <drepper@redhat.com>
+
+ * libio/iogetline.c: Set mode before the loop in case n==0.
+ * libio/iogetwline.c: Likewise.
+
+2000-08-29 H.J. Lu <hjl@gnu.org>
+
+ * libio/fileops.c (new_do_write): Check fp->_mode <= 0 instead
+ of fp->_mode < 0.
+ (_IO_new_file_overflow): Likewise.
+ * libio/genops.c (_IO_flush_all): Likewise.
+ * libio/ioftell.c (_IO_ftell): Likewise.
+
2000-08-29 Akira Higuchi <a@kondara.org>
* iconv/gconv_db.c (increment_counter): Reset __init_fct, __fct,
fp->_cur_column = _IO_adjust_column (fp->_cur_column - 1, data, count) + 1;
_IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_buf_base;
- fp->_IO_write_end = (fp->_mode < 0
+ fp->_IO_write_end = (fp->_mode <= 0
&& (fp->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED))
? fp->_IO_buf_base : fp->_IO_buf_end);
return count;
f->_IO_read_base = f->_IO_read_ptr = f->_IO_read_end;
f->_flags |= _IO_CURRENTLY_PUTTING;
- if (f->_mode < 0 && f->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED))
+ if (f->_mode <= 0 && f->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED))
f->_IO_write_end = f->_IO_write_ptr;
}
if (ch == EOF)
int result = 0;
struct _IO_FILE *fp;
for (fp = (_IO_FILE *) _IO_list_all; fp; fp = fp->_chain)
- if (((fp->_mode < 0 && fp->_IO_write_ptr > fp->_IO_write_base)
+ if (((fp->_mode <= 0 && fp->_IO_write_ptr > fp->_IO_write_base)
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
|| (fp->_vtable_offset == 0
&& fp->_mode > 0 && (fp->_wide_data->_IO_write_ptr
-/* 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
pos = _IO_seekoff (fp, 0, _IO_seek_cur, 0);
if (_IO_in_backup (fp))
{
- if (fp->_vtable_offset != 0 || fp->_mode < 0)
+ if (fp->_vtable_offset != 0 || fp->_mode <= 0)
pos -= fp->_IO_save_end - fp->_IO_save_base;
else
/* XXX For now. */
-/* Copyright (C) 1993, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997, 1998, 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
char *ptr = buf;
if (eof != NULL)
*eof = 0;
+ if (__builtin_expect (fp->_mode, -1) == 0)
+ _IO_fwide (fp, -1);
while (n != 0)
{
_IO_ssize_t len = fp->_IO_read_end - fp->_IO_read_ptr;
wchar_t *ptr = buf;
if (eof != NULL)
*eof = 0;
+ if (__builtin_expect (fp->_mode, 1) == 0)
+ _IO_fwide (fp, 1);
while (n != 0)
{
_IO_ssize_t len = (fp->_wide_data->_IO_read_end