From 1c663cf41c35a0a793b2df09c050e8f9d29a9a02 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 9 Dec 2004 16:14:46 -0500 Subject: BUG: Fix to avoid relative path with ..s all the way to the root. --- Source/cmSystemTools.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 7bb1283..07d46ef 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1245,8 +1245,9 @@ std::string cmSystemTools::RelativePath(const char* local, const char* remote) remoteSplit[sameCount] = ""; sameCount++; } - // If there is nothing in common with the paths, then just return the remote - if(sameCount == 0) + // If there is nothing in common but the root directory, then just + // return the full path. + if(sameCount <= 1) { return remote; } -- cgit v0.12