Explorar el Código

Revert "fix Sys.command for windows: always escape cmd, wrap resulting command in quotes before executing (see #3402)"

This reverts commit c0406cc928c71657284c9872415c6bd5b22b000e.
Dan Korostelev hace 11 años
padre
commit
cf34d28f1c
Se han modificado 3 ficheros con 3 adiciones y 6 borrados
  1. 1 2
      std/cpp/_std/Sys.hx
  2. 1 2
      std/neko/_std/Sys.hx
  3. 1 2
      std/php/_std/Sys.hx

+ 1 - 2
std/cpp/_std/Sys.hx

@@ -96,12 +96,11 @@
 	}
 
 	public static function command( cmd : String, ?args : Array<String> ) : Int {
-		cmd = escapeArgument(cmd);
 		if( args != null ) {
+			cmd = escapeArgument(cmd);
 			for( a in args )
 				cmd += " "+escapeArgument(a);
 		}
-		if (systemName() == "Windows") cmd = '"$cmd"';
 		return sys_command(cmd);
 	}
 

+ 1 - 2
std/neko/_std/Sys.hx

@@ -106,12 +106,11 @@
 	}
 
 	public static function command( cmd : String, ?args : Array<String> ) : Int {
-		cmd = escapeArgument(cmd);
 		if( args != null ) {
+			cmd = escapeArgument(cmd);
 			for( a in args )
 				cmd += " "+escapeArgument(a);
 		}
-		if (systemName() == "Windows") cmd = '"$cmd"';
 		return sys_command(untyped cmd.__s);
 	}
 

+ 1 - 2
std/php/_std/Sys.hx

@@ -84,12 +84,11 @@
 	}
 
 	public static function command( cmd : String, ?args : Array<String> ) : Int {
-		cmd = escapeArgument(cmd);
 		if( args != null ) {
+			cmd = escapeArgument(cmd);
 			for( a in args )
 				cmd += " "+escapeArgument(a);
 		}
-		if (systemName() == "Windows") cmd = '"$cmd"';
 		var result = 0;
 		untyped __call__("system", cmd, result);
 		return result;