diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2005-04-07 17:03:47 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2005-04-07 17:03:47 (GMT) |
commit | fadff337910f1c6faf5a2e36afe54b6ea1aee0e8 (patch) | |
tree | 44f592b1d166a27ef84edda7035f5042bf75cb27 /Source/kwsys/SystemTools.cxx | |
parent | a1d7482548641d6695a1470c9d276288aec058a5 (diff) | |
download | CMake-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/SystemTools.cxx')
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 20 |
1 files changed, 20 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) { |