Browse Source

[cs] fixed passing relative path to exe to sys.io.Process, when using mono on Windows

Andy Li 9 years ago
parent
commit
8507b76677
1 changed files with 3 additions and 0 deletions
  1. 3 0
      std/cs/_std/sys/io/Process.hx

+ 3 - 0
std/cs/_std/sys/io/Process.hx

@@ -39,6 +39,9 @@ class Process {
 	public function new( cmd : String, args : Array<String> ) : Void
 	{
 		this.native = new NativeProcess();
+		// mono 4.2.1 on Windows doesn't support relative path correctly
+		if (cmd.indexOf("/") != -1 || cmd.indexOf("\\") != -1)
+			cmd = sys.FileSystem.fullPath(cmd);
 		native.StartInfo.FileName = cmd;
 		native.StartInfo.CreateNoWindow = true;
 		native.StartInfo.Arguments = [