BUG: Fix for relative path conversion when path is a subset of relative path root.

This commit is contained in:
Brad King 2005-01-17 15:09:25 -05:00
parent e6e98b47da
commit 97a3d514ac
1 changed files with 4 additions and 2 deletions

View File

@ -2022,14 +2022,16 @@ cmLocalUnixMakefileGenerator2::ConvertToRelativePath(const char* p)
}
// If the entire path is in common then just return a ".".
if(common == path.size())
if(common == path.size() &&
common == m_CurrentOutputDirectoryComponents.size())
{
return ".";
}
// If the entire path is in common except for a trailing slash then
// just return a "./".
if(common+1 == path.size() && path[common].size() == 0)
if(common+1 == path.size() && path[common].size() == 0 &&
common == m_CurrentOutputDirectoryComponents.size())
{
return "./";
}