diff options
author | Brad King <brad.king@kitware.com> | 2004-12-09 21:14:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2004-12-09 21:14:46 (GMT) |
commit | 1c663cf41c35a0a793b2df09c050e8f9d29a9a02 (patch) | |
tree | e08791844cc8ac41c257e4254a47c34e85b0d90b | |
parent | c710a2366de2a6653921d8634737e5feeed79ea5 (diff) | |
download | CMake-1c663cf41c35a0a793b2df09c050e8f9d29a9a02.zip CMake-1c663cf41c35a0a793b2df09c050e8f9d29a9a02.tar.gz CMake-1c663cf41c35a0a793b2df09c050e8f9d29a9a02.tar.bz2 |
BUG: Fix to avoid relative path with ..s all the way to the root.
-rw-r--r-- | Source/cmSystemTools.cxx | 5 |
1 files 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; } |