From 310f95183a026af2d7854f830b185116aa770852 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 18 Aug 1999 23:05:23 +0000 Subject: Update. * libio/fileops.c (_IO_file_xsgetn): Allocate buffer if none is allocated so far. [PR libc/1261]. --- libio/fileops.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libio') diff --git a/libio/fileops.c b/libio/fileops.c index decb9d7..7c6e271 100644 --- a/libio/fileops.c +++ b/libio/fileops.c @@ -849,6 +849,17 @@ _IO_file_xsgetn (fp, data, n) want = n; + if (fp->_IO_buf_base == NULL) + { + /* Maybe we already have a push back pointer. */ + if (fp->_IO_save_base != NULL) + { + free (fp->_IO_save_base); + fp->_flags &= ~_IO_IN_BACKUP; + } + _IO_doallocbuf (fp); + } + while (want > 0) { have = fp->_IO_read_end - fp->_IO_read_ptr; -- cgit v1.1