Commit d2aa1afd authored by Paul Martin's avatar Paul Martin Committed by Brad King
Browse files

SystemTools: Update CopyFileAlways stream library workarounds

On some stream libraries failbit is not set when trying to read past
EOF.  Instead, always exit the copy loop when gcount() is zero.

Change-Id: Ied2a6a366ade185426c34ef58795e66472dc71dc
parent 1b75ad3d
...@@ -2375,6 +2375,10 @@ bool SystemTools::CopyFileAlways(const kwsys_stl::string& source, const kwsys_st ...@@ -2375,6 +2375,10 @@ bool SystemTools::CopyFileAlways(const kwsys_stl::string& source, const kwsys_st
{ {
fout.write(buffer, fin.gcount()); fout.write(buffer, fin.gcount());
} }
else
{
break;
}
} }
// Make sure the operating system has finished writing the file // Make sure the operating system has finished writing the file
......
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