Simplify absolute path conversions using CollapseFullPath full signature

This commit is contained in:
Brad King
2020-03-18 14:22:11 -04:00
parent 12b39aef75
commit 25f48761fa
7 changed files with 19 additions and 51 deletions
+2 -5
View File
@@ -2327,12 +2327,9 @@ bool HandleLockCommand(std::vector<std::string> const& args,
path += "/cmake.lock";
}
if (!cmsys::SystemTools::FileIsFullPath(path)) {
path = status.GetMakefile().GetCurrentSourceDirectory() + "/" + path;
}
// Unify path (remove '//', '/../', ...)
path = cmSystemTools::CollapseFullPath(path);
path = cmSystemTools::CollapseFullPath(
path, status.GetMakefile().GetCurrentSourceDirectory());
// Create file and directories if needed
std::string parentDir = cmSystemTools::GetParentDirectory(path);