BUG: Fix bug#5590. When converting a relative path between two full paths on different windows drive letters do not create a ../../d:/foo/bar path and just return the full path to the destination.
This commit is contained in:
parent
2d1bcf806f
commit
c4ffd00711
@ -2753,22 +2753,15 @@ kwsys_stl::string SystemTools::RelativePath(const char* local, const char* remot
|
|||||||
sameCount++;
|
sameCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
// If there is nothing in common at all then just return the full
|
||||||
// NOTE: We did this at one time to prevent relative paths to the
|
// path. This is the case only on windows when the paths have
|
||||||
// compiler from looking like "../../../../../../../usr/bin/gcc".
|
// different drive letters. On unix two full paths always at least
|
||||||
// Now however relative paths are only computed for destinations
|
// have the root "/" in common so we will return a relative path
|
||||||
// inside the build tree so this is not a problem. This is now a
|
// that passes through the root directory.
|
||||||
// general-purpose method and should not have this hack. I'm
|
if(sameCount == 0)
|
||||||
// leaving it in place in case removing it causes a problem so it is
|
|
||||||
// easy to restore:
|
|
||||||
//
|
|
||||||
// If there is nothing in common but the root directory, then just
|
|
||||||
// return the full path.
|
|
||||||
if(sameCount <= 1)
|
|
||||||
{
|
{
|
||||||
return remote;
|
return remote;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// for each entry that is not common in the local path
|
// for each entry that is not common in the local path
|
||||||
// add a ../ to the finalpath array, this gets us out of the local
|
// add a ../ to the finalpath array, this gets us out of the local
|
||||||
|
Loading…
x
Reference in New Issue
Block a user