From ccbdc30a8c9c1f763efecf19a0f15f1d1b43e74f Mon Sep 17 00:00:00 2001 From: Sebastien Barre Date: Tue, 26 Mar 2002 16:44:49 -0500 Subject: ENH: ExpandListArguments(): empty elements in semi-colon-separated string-list can now be ignored. --- Source/cmSystemTools.cxx | 8 ++++++-- Source/cmSystemTools.h | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 5102fa2..6f34c8e 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1609,7 +1609,8 @@ void cmSystemTools::GlobDirs(const char *fullPath, void cmSystemTools::ExpandListArguments(std::vector const& arguments, - std::vector& newargs) + std::vector& newargs, + bool ignore_empty) { std::vector::const_iterator i; for(i = arguments.begin();i != arguments.end(); ++i) @@ -1630,7 +1631,10 @@ void cmSystemTools::ExpandListArguments(std::vector const& argument { len = i->size()-start; } - newargs.push_back(i->substr(start, len)); + if (ignore_empty == false || len > 0) + { + newargs.push_back(i->substr(start, len)); + } start = endpos+1; } } diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 9cbd62a..b9f6842 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -48,7 +48,8 @@ public: * containing the expanded versions of all arguments in argsIn. */ static void ExpandListArguments(std::vector const& argsIn, - std::vector& argsOut); + std::vector& argsOut, + bool ignore_empty = false); /** * Look for and replace registry values in a string -- cgit v0.12