Added some unit tests for Stream::readLine_NEW, and clarified that readLine_NEW is essentially fgets in disguise

svn-id: r34384
This commit is contained in:
Max Horn 2008-09-06 16:46:28 +00:00
parent 5756308cec
commit 6cb09e311a
3 changed files with 53 additions and 18 deletions

View file

@ -166,9 +166,12 @@ char *SeekableReadStream::readLine_NEW(char *buf, size_t bufSize) {
c = readByte();
// If end-of-file occurs before any characters are read, return
// NULL and the buffer contents remain unchanged. If an error
/// occurs, return NULL and the buffer contents are indeterminate.
if (ioFailed() || (len == 0 && eos()))
// NULL and the buffer contents remain unchanged.
if (len == 0 && eos())
return 0;
// If an error occurs, return NULL and the buffer contents are indeterminate.
if (ioFailed())
return 0;
// Check for CR or CR/LF