浏览代码

BUG: Fix for relative path conversion when path is a subset of relative path root.

Brad King 21 年之前
父节点
当前提交
97a3d514ac
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      Source/cmLocalUnixMakefileGenerator2.cxx

+ 4 - 2
Source/cmLocalUnixMakefileGenerator2.cxx

@@ -2022,14 +2022,16 @@ cmLocalUnixMakefileGenerator2::ConvertToRelativePath(const char* p)
     }
     }
 
 
   // If the entire path is in common then just return a ".".
   // If the entire path is in common then just return a ".".
-  if(common == path.size())
+  if(common == path.size() &&
+     common == m_CurrentOutputDirectoryComponents.size())
     {
     {
     return ".";
     return ".";
     }
     }
 
 
   // If the entire path is in common except for a trailing slash then
   // If the entire path is in common except for a trailing slash then
   // just return a "./".
   // just return a "./".
-  if(common+1 == path.size() && path[common].size() == 0)
+  if(common+1 == path.size() && path[common].size() == 0 &&
+     common == m_CurrentOutputDirectoryComponents.size())
     {
     {
     return "./";
     return "./";
     }
     }