From 161bb50e0cb6bf6b7e42f3a01ad0d277b9b2c822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 24 Jul 2016 11:36:02 +0200 Subject: [PATCH] bump simplecpp --- externals/simplecpp/simplecpp.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/externals/simplecpp/simplecpp.cpp b/externals/simplecpp/simplecpp.cpp index 04bce1785..d591d3d9e 100644 --- a/externals/simplecpp/simplecpp.cpp +++ b/externals/simplecpp/simplecpp.cpp @@ -1203,9 +1203,15 @@ std::string simplifyPath(std::string path) { } // remove "xyz/../" - while ((pos = path.find("/../")) != std::string::npos) { + pos = 1U; + while ((pos = path.find("/../", pos)) != std::string::npos) { const std::string::size_type pos1 = path.rfind("/", pos - 1U); - path.erase(pos1,pos-pos1+3); + if (pos1 == std::string::npos) + pos++; + else { + path.erase(pos1,pos-pos1+3); + pos = std::min((std::string::size_type)1, pos1); + } } return path;