From 0f5f884a45ffd7f7465fb8836f1f6ac265cc2d5c Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 21 Sep 2001 09:40:07 -0400 Subject: [PATCH] BUG: CopyFile should return immediately after an error occurs. --- Source/cmSystemTools.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index f8e1874c1..c00f9d614 100644 --- a/Source/cmSystemTools.cxx +++ b/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()) {