Explorar o código

Quote argument to "cmd /c ..."

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@40549 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements %!s(int64=15) %!d(string=hai) anos
pai
achega
0d34aa73ba
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      lib/gis/spawn.c

+ 3 - 1
lib/gis/spawn.c

@@ -284,7 +284,7 @@ static char *make_command_line(int shell, const char *cmd, const char **argv)
     if (shell) {
 	const char *comspec = getenv("COMSPEC");
 	append(&result, comspec ? comspec : "cmd.exe");
-	append(&result, " /c ");
+	append(&result, " /c \"");
 	escape_arg(&result, cmd);
     }
 
@@ -294,6 +294,8 @@ static char *make_command_line(int shell, const char *cmd, const char **argv)
 	escape_arg(&result, argv[i]);
     }
 
+    append(&result, "\"");
+
     return release(&result);
 }