summaryrefslogtreecommitdiffstats
path: root/Source/kwsys
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-04-07 17:03:47 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2005-04-07 17:03:47 (GMT)
commitfadff337910f1c6faf5a2e36afe54b6ea1aee0e8 (patch)
tree44f592b1d166a27ef84edda7035f5042bf75cb27 /Source/kwsys
parenta1d7482548641d6695a1470c9d276288aec058a5 (diff)
downloadCMake-fadff337910f1c6faf5a2e36afe54b6ea1aee0e8.zip
CMake-fadff337910f1c6faf5a2e36afe54b6ea1aee0e8.tar.gz
CMake-fadff337910f1c6faf5a2e36afe54b6ea1aee0e8.tar.bz2
BUG: fix for bug 1717 incorrect path sent to dart server
Diffstat (limited to 'Source/kwsys')
-rw-r--r--Source/kwsys/SystemTools.cxx20
-rw-r--r--Source/kwsys/SystemTools.hxx.in8
2 files changed, 28 insertions, 0 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index c40d4c5..a0e5e7e 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -2228,11 +2228,31 @@ kwsys_stl::string SystemTools::CollapseFullPath(const char* in_path,
// Update the translation table with this potentially new path.
SystemTools::AddTranslationPath(newPath.c_str(), in_path);
SystemTools::CheckTranslationPath(newPath);
+#ifdef _WIN32
+ newPath = SystemTools::GetActualCaseForPath(newPath.c_str());
+#endif
// Return the reconstructed path.
return newPath;
}
//----------------------------------------------------------------------------
+kwsys_stl::string SystemTools::GetActualCaseForPath(const char* p)
+{
+#ifndef _WIN32
+ return p;
+#else
+ std::string path;
+ if(!SystemTools::GetShortPath(p, path))
+ {
+ return path;
+ }
+ char buffer[MAX_PATH+1];
+ ::GetLongPathName(path.c_str(), buffer, MAX_PATH+1);
+ return buffer;
+#endif
+}
+
+//----------------------------------------------------------------------------
void SystemTools::SplitPath(const char* p,
kwsys_stl::vector<kwsys_stl::string>& components)
{
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in
index 0a1d6db..eec2617 100644
--- a/Source/kwsys/SystemTools.hxx.in
+++ b/Source/kwsys/SystemTools.hxx.in
@@ -242,6 +242,14 @@ public:
static const char* GetExecutableExtension();
/**
+ * Given a path that exists on a windows machine, return the
+ * actuall case of the path as it was created. If the file
+ * does not exist path is returned unchanged. This does nothing
+ * on unix but return path.
+ */
+ static kwsys_stl::string GetActualCaseForPath(const char* path);
+
+ /**
* Given the path to a program executable, get the directory part of
* the path with the file stripped off. If there is no directory
* part, the empty string is returned.