diff options
author | Paul Martin <paul.martin@codethink.co.uk> | 2015-02-27 15:45:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-03-02 13:55:13 (GMT) |
commit | b8ea771b13989f353c2762abd40a65b6d33a1eb7 (patch) | |
tree | 076ba50b7710dd104010ecc0d6a4a9a6d36bf52c | |
parent | 99575c9ac114e6f5d388e1ee7b9a3f788d773c9e (diff) | |
download | CMake-b8ea771b13989f353c2762abd40a65b6d33a1eb7.zip CMake-b8ea771b13989f353c2762abd40a65b6d33a1eb7.tar.gz CMake-b8ea771b13989f353c2762abd40a65b6d33a1eb7.tar.bz2 |
KWSys 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.
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 2708211..b03e7b0 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -2330,6 +2330,10 @@ bool SystemTools::CopyFileAlways(const kwsys_stl::string& source, const kwsys_st { fout.write(buffer, fin.gcount()); } + else + { + break; + } } // Make sure the operating system has finished writing the file |