[Cmake-commits] [cmake-commits] king committed SystemTools.cxx 1.232 1.233 SystemTools.hxx.in 1.75 1.76

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Feb 9 09:23:15 EST 2009


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

Modified Files:
	SystemTools.cxx SystemTools.hxx.in 
Log Message:
BUG: Fix GetRealPath when realpath fails

This patch from Philip Lowman teaches SystemTools::GetRealPath to deal
with paths that do not exist by dealing with the case that realpath
returns NULL.  See issue #8423.


Index: SystemTools.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/SystemTools.cxx,v
retrieving revision 1.232
retrieving revision 1.233
diff -C 2 -d -r1.232 -r1.233
*** SystemTools.cxx	18 Dec 2008 15:43:23 -0000	1.232
--- SystemTools.cxx	9 Feb 2009 14:23:13 -0000	1.233
***************
*** 206,209 ****
--- 206,213 ----
      KWSYS_NAMESPACE::SystemTools::ConvertToUnixSlashes(resolved_path);
      }
+   else
+     {
+     resolved_path = path;
+     }
  }
  #else
***************
*** 238,243 ****
    char resolved_name[KWSYS_SYSTEMTOOLS_MAXPATH];
  
!   realpath(path, resolved_name);
!   resolved_path = resolved_name;
  }
  #endif
--- 242,255 ----
    char resolved_name[KWSYS_SYSTEMTOOLS_MAXPATH];
  
!   char *ret = realpath(path, resolved_name);
!   if(ret)
!     {
!     resolved_path = ret;
!     }
!   else
!     {
!     // if path resolution fails, return what was passed in
!     resolved_path = path;
!     }
  }
  #endif

Index: SystemTools.hxx.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/SystemTools.hxx.in,v
retrieving revision 1.75
retrieving revision 1.76
diff -C 2 -d -r1.75 -r1.76
*** SystemTools.hxx.in	18 Dec 2008 15:43:24 -0000	1.75
--- SystemTools.hxx.in	9 Feb 2009 14:23:13 -0000	1.76
***************
*** 352,356 ****
  
    /** 
!    * Get the real path for a given path, removing all symlinks.
     */
    static kwsys_stl::string GetRealPath(const char* path);
--- 352,358 ----
  
    /** 
!    * Get the real path for a given path, removing all symlinks.  In
!    * the event of an error (non-existent path, permissions issue,
!    * etc.) the original path is returned.
     */
    static kwsys_stl::string GetRealPath(const char* path);



More information about the Cmake-commits mailing list