瀏覽代碼

Merge topic 'avoid-remove-empty-path'

71ded12a75 cmGeneratedFileStream: Do not remove empty path

Acked-by: Kitware Robot <[email protected]>
Acked-by: buildbot <[email protected]>
Merge-request: !7223
Brad King 3 年之前
父節點
當前提交
29062b23cf
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      Source/cmGeneratedFileStream.cxx

+ 3 - 1
Source/cmGeneratedFileStream.cxx

@@ -180,7 +180,9 @@ bool cmGeneratedFileStreamBase::Close()
   // Else, the destination was not replaced.
   // Else, the destination was not replaced.
   //
   //
   // Always delete the temporary file. We never want it to stay around.
   // Always delete the temporary file. We never want it to stay around.
-  cmSystemTools::RemoveFile(this->TempName);
+  if (!this->TempName.empty()) {
+    cmSystemTools::RemoveFile(this->TempName);
+  }
 
 
   return replaced;
   return replaced;
 }
 }