Browse Source

Quote argument to "cmd /c ..."

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@40549 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 15 năm trước cách đây
mục cha
commit
0d34aa73ba
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  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);
 }