diff options
author | Brad King <brad.king@kitware.com> | 2018-06-22 15:31:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-06-22 15:31:36 (GMT) |
commit | f2d97c1cdf06f8575d0b23130db4ffa725ca5161 (patch) | |
tree | 8a8d5eeac45a9afc304573af316c63ebb6eccd6b /Source/kwsys/SystemTools.cxx | |
parent | 44ca3d922cc1da390eaea3673a025a9b96556afc (diff) | |
parent | 6d7fdedde6c41e6d5e7840a7d653d490296aa6e7 (diff) | |
download | CMake-f2d97c1cdf06f8575d0b23130db4ffa725ca5161.zip CMake-f2d97c1cdf06f8575d0b23130db4ffa725ca5161.tar.gz CMake-f2d97c1cdf06f8575d0b23130db4ffa725ca5161.tar.bz2 |
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
KWSys 2018-06-22 (49068d94)
Diffstat (limited to 'Source/kwsys/SystemTools.cxx')
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index b87b6b5..d552d9f 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -1752,11 +1752,11 @@ std::string SystemTools::CropString(const std::string& s, size_t max_len) return n; } -std::vector<kwsys::String> SystemTools::SplitString(const std::string& p, - char sep, bool isPath) +std::vector<std::string> SystemTools::SplitString(const std::string& p, + char sep, bool isPath) { std::string path = p; - std::vector<kwsys::String> paths; + std::vector<std::string> paths; if (path.empty()) { return paths; } @@ -3279,13 +3279,12 @@ std::string SystemTools::RelativePath(const std::string& local, std::string r = SystemTools::CollapseFullPath(remote); // split up both paths into arrays of strings using / as a separator - std::vector<kwsys::String> localSplit = - SystemTools::SplitString(l, '/', true); - std::vector<kwsys::String> remoteSplit = + std::vector<std::string> localSplit = SystemTools::SplitString(l, '/', true); + std::vector<std::string> remoteSplit = SystemTools::SplitString(r, '/', true); - std::vector<kwsys::String> + std::vector<std::string> commonPath; // store shared parts of path in this array - std::vector<kwsys::String> finalPath; // store the final relative path here + std::vector<std::string> finalPath; // store the final relative path here // count up how many matching directory names there are from the start unsigned int sameCount = 0; while (((sameCount <= (localSplit.size() - 1)) && @@ -3325,7 +3324,7 @@ std::string SystemTools::RelativePath(const std::string& local, } // for each entry that is not common in the remote path add it // to the final path. - for (std::vector<String>::iterator vit = remoteSplit.begin(); + for (std::vector<std::string>::iterator vit = remoteSplit.begin(); vit != remoteSplit.end(); ++vit) { if (!vit->empty()) { finalPath.push_back(*vit); @@ -3334,7 +3333,7 @@ std::string SystemTools::RelativePath(const std::string& local, std::string relativePath; // result string // now turn the array of directories into a unix path by puttint / // between each entry that does not already have one - for (std::vector<String>::iterator vit1 = finalPath.begin(); + for (std::vector<std::string>::iterator vit1 = finalPath.begin(); vit1 != finalPath.end(); ++vit1) { if (!relativePath.empty() && *relativePath.rbegin() != '/') { relativePath += "/"; |