소스 검색

BUG: CopyFile should return immediately after an error occurs.

Brad King 24 년 전
부모
커밋
0f5f884a45
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      Source/cmSystemTools.cxx

+ 2 - 0
Source/cmSystemTools.cxx

@@ -770,6 +770,7 @@ void cmSystemTools::cmCopyFile(const char* source,
     {
     cmSystemTools::Error("CopyFile failed to open input file \"",
                          source, "\"");
+    return;
     }
   std::ofstream fout(destination,
 #ifdef _WIN32                     
@@ -780,6 +781,7 @@ void cmSystemTools::cmCopyFile(const char* source,
     {
     cmSystemTools::Error("CopyFile failed to open output file \"",
                          destination, "\"");
+    return;
     }
   while(fin.getline(buffer, buffer_length, '\n') || fin.gcount())
     {