summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Baron <netz.frei freenet de>2012-07-18 18:09:44 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-07-18 18:10:07 +0100
commit2a50cb475bfaf331e2451bbe70c2b3bbdd1ad69d (patch)
treea6d27a355826909b22e2197110077fde36520dfe
parenta5d4c4aa35c3115f963a263ecae5879b5f58c453 (diff)
downloaddbus-2a50cb475bfaf331e2451bbe70c2b3bbdd1ad69d.tar.gz
Fix launching of dbus-daemon on Windows in paths containing spaces
If dbus is installed in a path, which contains a space, dbus-launch will not launch the daemon. That is so, because a command line is built from just the path to the daemon and a parameter. The path has to be surrounded with quotes. This can be done unconditionally, because the quotes do not cause any trouble even if they are not needed. Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49450
-rw-r--r--tools/dbus-launch-win.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/dbus-launch-win.c b/tools/dbus-launch-win.c
index ea4bf0dd..215fac3f 100644
--- a/tools/dbus-launch-win.c
+++ b/tools/dbus-launch-win.c
@@ -130,9 +130,10 @@ main (int argc, char **argv)
fprintf (stderr, "%ls %ls\n", dbusDaemonPath, command);
#else
command[0] = L'\0';
- /* Windows CE has a different interpretation of cmdline: Start with argv[1]. */
- wcscpy_s (command, sizeof (command), dbusDaemonPath);
- wcscat_s (command, sizeof (command), L" --session");
+ /* Windows cmdline starts with path, which can contain spaces. */
+ wcscpy_s (command, sizeof (command), L"\"");
+ wcscat_s (command, sizeof (command), dbusDaemonPath);
+ wcscat_s (command, sizeof (command), L"\" --session");
if (verbose)
fprintf (stderr, "%ls\n", command);
#endif