diff options
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) { |