diff options
author | Ulrich Drepper <drepper@redhat.com> | 1997-08-05 23:36:21 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1997-08-05 23:36:21 +0000 |
commit | 044b16f4e9ae773187f4fee8a9a0a54f9a51f13f (patch) | |
tree | 58bc41e16535e0d0f61d51e6af15ce4128864fc9 /libio | |
parent | c59a94711c6a9d38811b828863076f39000831b4 (diff) |
update for 2.0.5pre1
Diffstat (limited to 'libio')
-rw-r--r-- | libio/fileops.c | 14 | ||||
-rw-r--r-- | libio/libio.h | 2 | ||||
-rw-r--r-- | libio/strops.c | 4 |
3 files changed, 14 insertions, 6 deletions
diff --git a/libio/fileops.c b/libio/fileops.c index 3d494e31c1..afba972693 100644 --- a/libio/fileops.c +++ b/libio/fileops.c @@ -291,6 +291,15 @@ DEFUN(_IO_file_underflow, (fp), _IO_switch_to_get_mode(fp); + /* This is very tricky. We have to adjust those + pointers before we call _IO_SYSREAD () since + we may longjump () out while waiting for + input. Those pointers may be screwed up. H.J. */ + fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_buf_base; + fp->_IO_read_end = fp->_IO_buf_base; + fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end + = fp->_IO_buf_base; + count = _IO_SYSREAD (fp, fp->_IO_buf_base, fp->_IO_buf_end - fp->_IO_buf_base); if (count <= 0) @@ -300,10 +309,7 @@ DEFUN(_IO_file_underflow, (fp), else fp->_flags |= _IO_ERR_SEEN, count = 0; } - fp->_IO_read_base = fp->_IO_read_ptr = fp->_IO_buf_base; - fp->_IO_read_end = fp->_IO_buf_base + count; - fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_write_end - = fp->_IO_buf_base; + fp->_IO_read_end += count; if (count == 0) return EOF; if (fp->_offset != _IO_pos_BAD) diff --git a/libio/libio.h b/libio/libio.h index d0a76c34b2..20eb5a9e1a 100644 --- a/libio/libio.h +++ b/libio/libio.h @@ -127,6 +127,7 @@ the executable file might be covered by the GNU General Public License. */ #define _IO_CURRENTLY_PUTTING 0x800 #define _IO_IS_APPENDING 0x1000 #define _IO_IS_FILEBUF 0x2000 +#define _IO_BAD_SEEN 0x4000 /* These are "formatting flags" matching the iostream fmtflags enum values. */ #define _IO_SKIPWS 01 @@ -145,6 +146,7 @@ the executable file might be covered by the GNU General Public License. */ #define _IO_UNITBUF 020000 #define _IO_STDIO 040000 #define _IO_DONT_CLOSE 0100000 +#define _IO_BOOLALPHA 0200000 struct _IO_jump_t; struct _IO_FILE; diff --git a/libio/strops.c b/libio/strops.c index 9c2650f352..afc293bd7d 100644 --- a/libio/strops.c +++ b/libio/strops.c @@ -88,7 +88,7 @@ DEFUN(_IO_str_init_static, (fp, ptr, size, pstart), if (pstart) { fp->_IO_write_ptr = pstart; - fp->_IO_write_end = ptr+size; + fp->_IO_write_end = ptr + size; fp->_IO_read_end = pstart; } else @@ -193,7 +193,7 @@ _IO_ssize_t DEFUN(_IO_str_count, (fp), register _IO_FILE *fp) { - return (fp->_IO_write_ptr > fp->_IO_read_end ? fp->_IO_write_ptr + return (fp->_IO_write_end > fp->_IO_read_end ? fp->_IO_write_end : fp->_IO_read_end) - fp->_IO_read_base; } |