summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-11-10 12:34:21 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-11-10 12:34:24 (GMT)
commitc1a55e333f99062530386b51675b9ea3c4bf40c9 (patch)
tree99afd5c841f424aaf933a25585a7a5690b655fde /Source
parent6d20c44f3df2b642235b64ba4be789cd9e2b5362 (diff)
parent8bef3e31bddf1ea7ab3fe6a0871e76d52806cfcb (diff)
downloadCMake-c1a55e333f99062530386b51675b9ea3c4bf40c9.zip
CMake-c1a55e333f99062530386b51675b9ea3c4bf40c9.tar.gz
CMake-c1a55e333f99062530386b51675b9ea3c4bf40c9.tar.bz2
Merge topic 'update-kwsys'
8bef3e31 Merge branch 'upstream-KWSys' into update-kwsys e8d0b431 KWSys 2017-11-09 (40d7b1bb) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1467
Diffstat (limited to 'Source')
-rw-r--r--Source/kwsys/SystemTools.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 1f7ee10..50aa857 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -27,6 +27,7 @@
#include <iostream>
#include <set>
#include <sstream>
+#include <utility>
#include <vector>
// Work-around CMake dependency scanning limitation. This must
@@ -3372,7 +3373,7 @@ std::string SystemTools::RelativePath(const std::string& local,
}
#ifdef _WIN32
-static std::string GetCasePathName(std::string const& pathIn)
+static std::pair<std::string, bool> GetCasePathName(std::string const& pathIn)
{
std::string casePath;
std::vector<std::string> path_components;
@@ -3381,7 +3382,7 @@ static std::string GetCasePathName(std::string const& pathIn)
{
// Relative paths cannot be converted.
casePath = pathIn;
- return casePath;
+ return std::make_pair(casePath, false);
}
// Start with root component.
@@ -3433,7 +3434,7 @@ static std::string GetCasePathName(std::string const& pathIn)
casePath += path_components[idx];
}
- return casePath;
+ return std::make_pair(casePath, converting);
}
#endif
@@ -3448,12 +3449,14 @@ std::string SystemTools::GetActualCaseForPath(const std::string& p)
if (i != SystemTools::PathCaseMap->end()) {
return i->second;
}
- std::string casePath = GetCasePathName(p);
- if (casePath.size() > MAX_PATH) {
- return casePath;
+ std::pair<std::string, bool> casePath = GetCasePathName(p);
+ if (casePath.first.size() > MAX_PATH) {
+ return casePath.first;
}
- (*SystemTools::PathCaseMap)[p] = casePath;
- return casePath;
+ if (casePath.second) {
+ (*SystemTools::PathCaseMap)[p] = casePath.first;
+ }
+ return casePath.first;
#endif
}