فهرست منبع

Fix for run command on windows. If you specify command in quotes but not full path, it should still work

Andy Cedilnik 23 سال پیش
والد
کامیت
51f399ca29
1فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
  1. 6 2
      Source/cmSystemTools.cxx

+ 6 - 2
Source/cmSystemTools.cxx

@@ -1508,9 +1508,13 @@ bool cmSystemTools::RunCommand(const char* command,
         std::string shortCmd;
         std::string cmd = quoted.match(1);
         std::string args = quoted.match(2);
-        if(!cmSystemTools::GetShortPath(cmd.c_str(), shortCmd))
+        if(! cmSystemTools::FileExists(cmd.c_str()) )
           {
-          cmSystemTools::Error("GetShortPath failed for " , cmd.c_str());
+          shortCmd = cmd;
+          }
+        else if(!cmSystemTools::GetShortPath(cmd.c_str(), shortCmd))
+          {
+         cmSystemTools::Error("GetShortPath failed for " , cmd.c_str());
           return false;
           }
         shortCmd += " ";