mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-16 05:49:56 +08:00
(_IO_getline_info): Don't read anything for N==0.
From-SVN: r21973
This commit is contained in:
parent
55895a7a34
commit
e94bc5f266
@ -1,3 +1,8 @@
|
||||
1998-08-25 14:34 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* libio/iogetline.c (_IO_getline_info): Don't read anything for
|
||||
N == 0. Patch by HJ Lu.
|
||||
|
||||
1998-08-23 Mark Mitchell <mark@markmitchell.com>
|
||||
|
||||
* iomanip.h: Use __extension__ for `extern' explicit template
|
||||
|
@ -58,7 +58,7 @@ _IO_getline_info (fp, buf, n, delim, extract_delim, eof)
|
||||
{
|
||||
char *ptr = buf;
|
||||
if (eof) *eof = 0;
|
||||
do
|
||||
while (n != 0)
|
||||
{
|
||||
_IO_ssize_t len = fp->_IO_read_end - fp->_IO_read_ptr;
|
||||
if (len <= 0)
|
||||
@ -105,7 +105,7 @@ _IO_getline_info (fp, buf, n, delim, extract_delim, eof)
|
||||
ptr += len;
|
||||
n -= len;
|
||||
}
|
||||
} while (n != 0);
|
||||
}
|
||||
return ptr - buf;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user