This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, master has been updated via 75850db66758ccdb4500ca0d580a2b97215a9357 (commit) via 5e9bd8a2ea759c4f7e412a8591ee55fe057313dc (commit) via 50988f6d763d99dc7d016000157528fa0ab20086 (commit) from 09e10f0937f971a5314a0b8f46c961c8c6e7fb2c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=75850db66758ccdb4500ca0d580a2b97215a9357 commit 75850db66758ccdb4500ca0d580a2b97215a9357 Merge: 09e10f0 5e9bd8a Author: Brad King <brad.k...@kitware.com> AuthorDate: Thu Jun 1 17:33:00 2017 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Thu Jun 1 13:34:11 2017 -0400 Merge topic 'update-kwsys' 5e9bd8a2 Merge branch 'upstream-KWSys' into update-kwsys 50988f6d KWSys 2017-05-31 (bd0bbad7) Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !915 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5e9bd8a2ea759c4f7e412a8591ee55fe057313dc commit 5e9bd8a2ea759c4f7e412a8591ee55fe057313dc Merge: de16ff3 50988f6 Author: Brad King <brad.k...@kitware.com> AuthorDate: Wed May 31 09:11:14 2017 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Wed May 31 09:11:14 2017 -0400 Merge branch 'upstream-KWSys' into update-kwsys * upstream-KWSys: KWSys 2017-05-31 (bd0bbad7) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=50988f6d763d99dc7d016000157528fa0ab20086 commit 50988f6d763d99dc7d016000157528fa0ab20086 Author: KWSys Upstream <kwro...@kitware.com> AuthorDate: Wed May 31 08:56:55 2017 -0400 Commit: Brad King <brad.k...@kitware.com> CommitDate: Wed May 31 09:11:11 2017 -0400 KWSys 2017-05-31 (bd0bbad7) Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit bd0bbad7f47776565d87aeb3657250974a426190 (master). Upstream Shortlog ----------------- Daniel Pfeifer (1): 0f7ec930 Pass std::string as const& Matteo Settenvini (1): 6173f4b3 SystemTools: Add function to remove empty path components diff --git a/SystemInformation.cxx b/SystemInformation.cxx index bfc895e..b7bd102 100644 --- a/SystemInformation.cxx +++ b/SystemInformation.cxx @@ -918,7 +918,8 @@ int LoadLines(const char* fileName, std::vector<std::string>& lines) // **************************************************************************** template <typename T> -int NameValue(std::vector<std::string>& lines, std::string name, T& value) +int NameValue(std::vector<std::string> const& lines, std::string const& name, + T& value) { size_t nLines = lines.size(); for (size_t i = 0; i < nLines; ++i) { diff --git a/SystemTools.cxx b/SystemTools.cxx index 5ca382f..07da8dc 100644 --- a/SystemTools.cxx +++ b/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__) diff --git a/SystemTools.hxx.in b/SystemTools.hxx.in index 0849e1d..5e091c2 100644 --- a/SystemTools.hxx.in +++ b/SystemTools.hxx.in @@ -474,6 +474,10 @@ public: static std::string JoinPath(std::vector<std::string>::const_iterator first, std::vector<std::string>::const_iterator last); + /** Removes empty components from path. + */ + static void RemoveEmptyPathElements(std::vector<std::string>& path); + /** * Compare a path or components of a path. */ diff --git a/testSystemTools.cxx b/testSystemTools.cxx index 900894c..e6fbf6c 100644 --- a/testSystemTools.cxx +++ b/testSystemTools.cxx @@ -54,7 +54,8 @@ static const char* toUnixPaths[][2] = { { 0, 0 } }; -static bool CheckConvertToUnixSlashes(std::string input, std::string output) +static bool CheckConvertToUnixSlashes(std::string const& input, + std::string const& output) { std::string result = input; kwsys::SystemTools::ConvertToUnixSlashes(result); @@ -71,8 +72,9 @@ static const char* checkEscapeChars[][4] = { { "1 foo 2 bar 2", "12", "\\", { " {} ", "{}", "#", " #{#} " }, { 0, 0, 0, 0 } }; -static bool CheckEscapeChars(std::string input, const char* chars_to_escape, - char escape_char, std::string output) +static bool CheckEscapeChars(std::string const& input, + const char* chars_to_escape, char escape_char, + std::string const& output) { std::string result = kwsys::SystemTools::EscapeChars( input.c_str(), chars_to_escape, escape_char); ----------------------------------------------------------------------- Summary of changes: Source/kwsys/SystemInformation.cxx | 3 ++- Source/kwsys/SystemTools.cxx | 11 +++++++++++ Source/kwsys/SystemTools.hxx.in | 4 ++++ Source/kwsys/testSystemTools.cxx | 8 +++++--- 4 files changed, 22 insertions(+), 4 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits