BUG: Work around broken GetLongPathName case

On Windows the GetLongPathName API function does not work on some
filesystems even if the file exists.  In this case we should just use
the original long path name and not the GetShortPathName result.
See issue #8480.
This commit is contained in:
Brad King 2009-02-09 16:45:15 -05:00
parent dda19cd36f
commit 6ed916795d
1 changed files with 5 additions and 0 deletions

View File

@ -3058,6 +3058,11 @@ kwsys_stl::string SystemTools::GetActualCaseForPath(const char* p)
{
return p;
}
// Use original path if conversion back to a long path failed.
if(longPath == shortPath)
{
longPath = p;
}
// make sure drive letter is always upper case
if(longPath.size() > 1 && longPath[1] == ':')
{