Commit 07e53e37 authored by Bill Hoffman's avatar Bill Hoffman
Browse files

BUG: fix for bug 1717 incorrect path sent to dart server

parent 5f96d3a1
......@@ -2228,10 +2228,30 @@ 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)
......
......@@ -241,6 +241,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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment