ENH: check return value of GetLongPath

This commit is contained in:
Bill Hoffman 2005-04-07 16:58:02 -04:00
parent f50e904faf
commit be32b258cb
1 changed files with 5 additions and 1 deletions

View File

@ -2247,7 +2247,11 @@ kwsys_stl::string SystemTools::GetActualCaseForPath(const char* p)
return path;
}
char buffer[MAX_PATH+1];
::GetLongPathName(path.c_str(), buffer, MAX_PATH+1);
int len = ::GetLongPathName(path.c_str(), buffer, MAX_PATH+1);
if(len == 0 || len > MAX_PATH+1)
{
return path;
}
return buffer;
#endif
}