summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-07-20 15:09:58 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-07-20 15:09:58 (GMT)
commit6d3ba1ed2753de237b467da50bcd5630f758456a (patch)
tree175e3ac04f8f1c112b1a652491a9d0db45fca250
parent42ea896d22cb2f04b08546918521fe7972a6174b (diff)
downloadCMake-6d3ba1ed2753de237b467da50bcd5630f758456a.zip
CMake-6d3ba1ed2753de237b467da50bcd5630f758456a.tar.gz
CMake-6d3ba1ed2753de237b467da50bcd5630f758456a.tar.bz2
BUG: If source and destination is the same file, then do not copy file always
-rw-r--r--Source/kwsys/SystemTools.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index c13ffc2..82c6525 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -910,6 +910,11 @@ bool SystemTools::FilesDiffer(const char* source,
*/
bool SystemTools::CopyFileAlways(const char* source, const char* destination)
{
+ // If files are the same do not copy
+ if ( SystemTools::SameFile(source, destination) )
+ {
+ return true;
+ }
const int bufferSize = 4096;
char buffer[bufferSize];