From dd78faf4154e35d38b1b030b27414ad82a35a4cb Mon Sep 17 00:00:00 2001 From: djcb Date: Thu, 8 Mar 2012 00:12:06 +0200 Subject: [PATCH] * mu_util_play: accept paths with spaces etc. as well --- src/mu-util.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mu-util.c b/src/mu-util.c index 5f38930c..07248e87 100644 --- a/src/mu-util.c +++ b/src/mu-util.c @@ -332,7 +332,7 @@ mu_util_play (const char *path, gboolean allow_local, gboolean allow_remote) gboolean rv; GError *err; const gchar *prog; - char *cmdline; + char *cmdline, *escpath; g_return_val_if_fail (path, FALSE); g_return_val_if_fail (mu_util_is_local_file (path) || allow_remote, @@ -349,7 +349,10 @@ mu_util_play (const char *path, gboolean allow_local, gboolean allow_remote) #endif /*!__APPLE__*/ } - cmdline = g_strconcat (prog, " ", path, NULL); + escpath = g_strescape (path, NULL); + cmdline = g_strdup_printf ("%s \"%s\"", prog, escpath); + g_free (escpath); + err = NULL; rv = g_spawn_command_line_async (cmdline, &err); if (!rv) {