summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-02-13 17:04:11 +0100
committerRobin Gareus <robin@gareus.org>2016-02-13 17:04:11 +0100
commit73245c621706dfa71f279506155a5b2707195d9b (patch)
treef7c20d8d8be9ecc2f6307dbe929bbdef4eb1cb63
parentfc5c247aa152235a749180bd0e86efe0ce32a20a (diff)
some half-baked support for windows command-arg substitutions
-rw-r--r--libs/pbd/system_exec.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/libs/pbd/system_exec.cc b/libs/pbd/system_exec.cc
index a19e873da2..fe74bbf133 100644
--- a/libs/pbd/system_exec.cc
+++ b/libs/pbd/system_exec.cc
@@ -170,6 +170,7 @@ SystemExec::init ()
stdinP[0] = stdinP[1] = INVALID_HANDLE_VALUE;
stdoutP[0] = stdoutP[1] = INVALID_HANDLE_VALUE;
stderrP[0] = stderrP[1] = INVALID_HANDLE_VALUE;
+ w_args = NULL;
#endif
}
@@ -199,6 +200,14 @@ SystemExec::SystemExec (std::string command, const std::map<char, std::string> s
init ();
make_argp_escaped(command, subs);
+#ifdef PLATFORM_WINDOWS
+ std::string wa;
+ for (int i = 0; argp[i]; ++i) {
+ if (!wa.empty ()) wa += " ";
+ wa += '"' + argp[i] + '"';
+ }
+ w_args = strdup(wa.c_str());
+#else
if (find_file (Searchpath (Glib::getenv ("PATH")), argp[0], cmd)) {
// argp[0] exists in $PATH` - set it to the actual path where it was found
free (argp[0]);
@@ -208,7 +217,7 @@ SystemExec::SystemExec (std::string command, const std::map<char, std::string> s
// Glib::find_program_in_path () is only available in Glib >= 2.28
// cmd = Glib::find_program_in_path (argp[0]);
-
+#endif
make_envp();
}