summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/SystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-05-31 13:11:14 (GMT)
committerBrad King <brad.king@kitware.com>2017-05-31 13:11:14 (GMT)
commit5e9bd8a2ea759c4f7e412a8591ee55fe057313dc (patch)
tree3b041d7b7419af79a71471994f3d98cbc62f46cf /Source/kwsys/SystemTools.cxx
parentde16ff3e58b0518c707ae877e80b6f81e26a4326 (diff)
parent50988f6d763d99dc7d016000157528fa0ab20086 (diff)
downloadCMake-5e9bd8a2ea759c4f7e412a8591ee55fe057313dc.zip
CMake-5e9bd8a2ea759c4f7e412a8591ee55fe057313dc.tar.gz
CMake-5e9bd8a2ea759c4f7e412a8591ee55fe057313dc.tar.bz2
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys: KWSys 2017-05-31 (bd0bbad7)
Diffstat (limited to 'Source/kwsys/SystemTools.cxx')
-rw-r--r--Source/kwsys/SystemTools.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 5ca382f..07da8dc 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -22,6 +22,7 @@
#include KWSYS_HEADER(FStream.hxx)
#include KWSYS_HEADER(Encoding.hxx)
+#include <algorithm>
#include <fstream>
#include <iostream>
#include <set>
@@ -3708,6 +3709,16 @@ std::string SystemTools::JoinPath(
return result;
}
+void SystemTools::RemoveEmptyPathElements(std::vector<std::string>& path)
+{
+ if (path.empty()) {
+ return;
+ }
+
+ path.erase(std::remove(path.begin() + 1, path.end(), std::string("")),
+ path.end());
+}
+
bool SystemTools::ComparePath(const std::string& c1, const std::string& c2)
{
#if defined(_WIN32) || defined(__APPLE__)