BUG: strlen(buffer) from getline may be 2 less than gcount on windows because both the CR and LF characters may be removed.
This commit is contained in:
parent
d58ce81fc0
commit
0aeb0b8892
|
@ -2422,7 +2422,7 @@ bool cmSystemTools::GetLineFromStream(std::istream& is, std::string& line)
|
||||||
// If newline character was read, the gcount includes the
|
// If newline character was read, the gcount includes the
|
||||||
// character, but the buffer does not. The end of line has been
|
// character, but the buffer does not. The end of line has been
|
||||||
// reached.
|
// reached.
|
||||||
if(strlen(buffer) == static_cast<size_t>(is.gcount()-1))
|
if(strlen(buffer) < static_cast<size_t>(is.gcount()))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue