[cmake-commits] king committed SystemTools.cxx 1.205 1.206

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Oct 25 13:29:49 EDT 2007


Update of /cvsroot/CMake/CMake/Source/kwsys
In directory public:/mounts/ram/cvs-serv22753

Modified Files:
	SystemTools.cxx 
Log Message:
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.


Index: SystemTools.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/SystemTools.cxx,v
retrieving revision 1.205
retrieving revision 1.206
diff -u -d -r1.205 -r1.206
--- SystemTools.cxx	12 Oct 2007 13:58:17 -0000	1.205
+++ SystemTools.cxx	25 Oct 2007 17:29:47 -0000	1.206
@@ -2753,22 +2753,15 @@
     sameCount++;
     }
 
-#if 0
-  // NOTE: We did this at one time to prevent relative paths to the
-  // compiler from looking like "../../../../../../../usr/bin/gcc".
-  // Now however relative paths are only computed for destinations
-  // inside the build tree so this is not a problem.  This is now a
-  // general-purpose method and should not have this hack.  I'm
-  // 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)
+  // If there is nothing in common at all then just return the full
+  // path.  This is the case only on windows when the paths have
+  // different drive letters.  On unix two full paths always at least
+  // have the root "/" in common so we will return a relative path
+  // that passes through the root directory.
+  if(sameCount == 0)
     {
     return remote;
     }
-#endif
 
   // for each entry that is not common in the local path
   // add a ../ to the finalpath array, this gets us out of the local



More information about the Cmake-commits mailing list