From cde17935ea0e4a75c2ca7b64455dfc644480836a Mon Sep 17 00:00:00 2001 From: x29a <0.x29a.0@gmail.com> Date: Thu, 22 Jun 2017 16:49:36 +0200 Subject: [PATCH 1/2] only use each include path once --- lib/importproject.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/importproject.cpp b/lib/importproject.cpp index 03c61f3ec..34b4d7c6a 100644 --- a/lib/importproject.cpp +++ b/lib/importproject.cpp @@ -122,7 +122,12 @@ static bool simplifyPathWithVariables(std::string &s, const std::map &in, const std::map &variables) { std::list I; - for (std::list::const_iterator it = in.begin(); it != in.end(); ++it) { + // only parse each includePath once - so remove duplicates + std::list uniqueIncludePaths = in; + uniqueIncludePaths.sort(); + uniqueIncludePaths.unique(); + + for (std::list::const_iterator it = uniqueIncludePaths.begin(); uniqueIncludePaths != in.end(); ++it) { if (it->empty()) continue; if (it->compare(0,2,"%(")==0) From b3a747d6061902d9017de7784ea95fcabc65b9d3 Mon Sep 17 00:00:00 2001 From: x29a <0.x29a.0@gmail.com> Date: Thu, 22 Jun 2017 16:53:13 +0200 Subject: [PATCH 2/2] fix brainfart --- lib/importproject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/importproject.cpp b/lib/importproject.cpp index 34b4d7c6a..51e583147 100644 --- a/lib/importproject.cpp +++ b/lib/importproject.cpp @@ -127,7 +127,7 @@ void ImportProject::FileSettings::setIncludePaths(const std::string &basepath, c uniqueIncludePaths.sort(); uniqueIncludePaths.unique(); - for (std::list::const_iterator it = uniqueIncludePaths.begin(); uniqueIncludePaths != in.end(); ++it) { + for (std::list::const_iterator it = uniqueIncludePaths.begin(); it != uniqueIncludePaths.end(); ++it) { if (it->empty()) continue; if (it->compare(0,2,"%(")==0)