diff options
author | Brad King <brad.king@kitware.com> | 2019-03-20 15:32:01 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-03-20 15:32:12 (GMT) |
commit | 23a84ac99006043338ce41bf68314e31ababf6dc (patch) | |
tree | e907935a605e120aa22dfccecbb3deabb7643bf9 /Source/cmSystemTools.cxx | |
parent | 51f3a76ab23fda217e61f0d2a53272836897717f (diff) | |
parent | b52d9d69603fa430750fe3528aef2400f5edcda2 (diff) | |
download | CMake-23a84ac99006043338ce41bf68314e31ababf6dc.zip CMake-23a84ac99006043338ce41bf68314e31ababf6dc.tar.gz CMake-23a84ac99006043338ce41bf68314e31ababf6dc.tar.bz2 |
Merge topic 'dedup-path-normalization'
b52d9d6960 cmSystemTools: Drop unused CollapseCombinedPath method
a13a5c948e Replace use of CollapseCombinedPath with CollapseFullPath
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sebastian Holtermann <sebholt@xwmw.org>
Merge-request: !3117
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 41f8cf4..d201061 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1510,36 +1510,6 @@ std::string cmSystemTools::ForceToRelativePath(std::string const& local_path, return relative; } -std::string cmSystemTools::CollapseCombinedPath(std::string const& dir, - std::string const& file) -{ - if (dir.empty() || dir == ".") { - return file; - } - - std::vector<std::string> dirComponents; - std::vector<std::string> fileComponents; - cmSystemTools::SplitPath(dir, dirComponents); - cmSystemTools::SplitPath(file, fileComponents); - - if (fileComponents.empty()) { - return dir; - } - if (!fileComponents[0].empty()) { - // File is not a relative path. - return file; - } - - std::vector<std::string>::iterator i = fileComponents.begin() + 1; - while (i != fileComponents.end() && *i == ".." && dirComponents.size() > 1) { - ++i; // Remove ".." file component. - dirComponents.pop_back(); // Remove last dir component. - } - - dirComponents.insert(dirComponents.end(), i, fileComponents.end()); - return cmSystemTools::JoinPath(dirComponents); -} - #ifdef CMAKE_BUILD_WITH_CMAKE bool cmSystemTools::UnsetEnv(const char* value) { |