Commit 7a9c0eea authored by David Cole's avatar David Cole

Fix crash on Windows. If input stream is no good, do not try to read a line...

Fix crash on Windows. If input stream is no good, do not try to read a line from it. Return false and an empty line instead...
parent fbb01944
......@@ -3959,10 +3959,11 @@ bool SystemTools::GetLineFromStream(kwsys_ios::istream& is,
line = "";
long leftToRead = sizeLimit;
// If no characters are read from the stream, the end of file has
// been reached. Clear the fail bit just before reading.
while(!haveNewline &&
while(is &&
!haveNewline &&
leftToRead != 0 &&
(is.clear(is.rdstate() & ~kwsys_ios::ios::failbit),
is.getline(buffer, bufferSize), is.gcount() > 0))
......
......@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2009)
SET(KWSYS_DATE_STAMP_MONTH 10)
# KWSys version date day component. Format is DD.
SET(KWSYS_DATE_STAMP_DAY 09)
SET(KWSYS_DATE_STAMP_DAY 16)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment