소스 검색

BUG: If source and destination is the same file, then do not copy file always

Andy Cedilnik 21 년 전
부모
커밋
6d3ba1ed27
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      Source/kwsys/SystemTools.cxx

+ 5 - 0
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];