BUG: filx for old bug in rel path computaiton code
This commit is contained in:
parent
8c65179339
commit
3744464c5e
@ -933,16 +933,14 @@ cmGlobalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
|
|||||||
// The local path should never have a trailing slash.
|
// The local path should never have a trailing slash.
|
||||||
assert(local.size() > 0 && !(local[local.size()-1] == ""));
|
assert(local.size() > 0 && !(local[local.size()-1] == ""));
|
||||||
|
|
||||||
// If the path is already relative or relative paths are disabled
|
// If the path is already relative then just return the path.
|
||||||
// then just return the path.
|
if(!cmSystemTools::FileIsFullPath(in_remote))
|
||||||
if(m_RelativePathTop.size() == 0 ||
|
|
||||||
!cmSystemTools::FileIsFullPath(in_remote))
|
|
||||||
{
|
{
|
||||||
return in_remote;
|
return in_remote;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the path does not begin with the minimum relative path prefix
|
// if the path does not contain all of the relative top path then return
|
||||||
// then do not convert it.
|
// because it is going too far out of the tree
|
||||||
std::string original = in_remote;
|
std::string original = in_remote;
|
||||||
if(original.size() < m_RelativePathTop.size() ||
|
if(original.size() < m_RelativePathTop.size() ||
|
||||||
!cmSystemTools::ComparePath(
|
!cmSystemTools::ComparePath(
|
||||||
@ -965,6 +963,12 @@ cmGlobalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
|
|||||||
++common;
|
++common;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if nothiong is in common the return
|
||||||
|
if (common == 0)
|
||||||
|
{
|
||||||
|
return in_remote;
|
||||||
|
}
|
||||||
|
|
||||||
// If the entire path is in common then just return a ".".
|
// If the entire path is in common then just return a ".".
|
||||||
if(common == remote.size() &&
|
if(common == remote.size() &&
|
||||||
common == local.size())
|
common == local.size())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user