فهرست منبع

BUG: Fix to avoid relative path with ..s all the way to the root.

Brad King 21 سال پیش
والد
کامیت
1c663cf41c
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 3 2
      Source/cmSystemTools.cxx

+ 3 - 2
Source/cmSystemTools.cxx

@@ -1245,8 +1245,9 @@ std::string cmSystemTools::RelativePath(const char* local, const char* remote)
     remoteSplit[sameCount] = "";
     remoteSplit[sameCount] = "";
     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;
     return remote;
     }
     }