Merge topic 'avoid-remove-empty-path'

71ded12a75 cmGeneratedFileStream: Do not remove empty path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7223
This commit is contained in:
Brad King
2022-05-03 15:24:26 +00:00
committed by Kitware Robot
+3 -1
View File
@@ -180,7 +180,9 @@ bool cmGeneratedFileStreamBase::Close()
// Else, the destination was not replaced.
//
// 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;
}