浏览代码

cmSystemTools: Reduce rightward drift in success path on UNIX

Brad King 1 年之前
父节点
当前提交
f6acf1f7b7
共有 1 个文件被更改,包括 3 次插入5 次删除
  1. 3 5
      Source/cmSystemTools.cxx

+ 3 - 5
Source/cmSystemTools.cxx

@@ -2736,13 +2736,11 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
 #else
   std::string errorMsg;
   std::string exe;
-  if (cmSystemTools::FindProgramPath(argv0, exe, errorMsg)) {
-    // remove symlinks
-    exe = cmSystemTools::GetRealPath(exe);
-    exe_dir = cmSystemTools::GetFilenamePath(exe);
-  } else {
+  if (!cmSystemTools::FindProgramPath(argv0, exe, errorMsg)) {
     // ???
   }
+  exe = cmSystemTools::GetRealPath(exe);
+  exe_dir = cmSystemTools::GetFilenamePath(exe);
 #endif
   cmSystemToolsCMakeCommand =
     cmStrCat(exe_dir, "/cmake", cmSystemTools::GetExecutableExtension());