changeset 16897:ff85eb760c7d

merge of '124e6be3465f8d19ae38e557d6609fe2fa4f787a' and '296e8ceb51de5268dfac776070185220b6ec5d4a'
author William Ehlhardt <williamehlhardt@gmail.com>
date Sat, 05 May 2007 05:19:11 +0000
parents 64b7d4ebd2b2 (diff) bcba07153da5 (current diff)
children a00cf76108c6 6502a3846264
files
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtksound.c	Sat May 05 04:08:07 2007 +0000
+++ b/pidgin/gtksound.c	Sat May 05 05:19:11 2007 +0000
@@ -418,6 +418,7 @@
 	if (!strcmp(method, "custom")) {
 		const char *sound_cmd;
 		char *command;
+		char *esc_filename;
 		GError *error = NULL;
 
 		sound_cmd = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/sound/command");
@@ -429,16 +430,19 @@
 			return;
 		}
 
+		esc_filename = g_strdup_printf("'%s'", filename);
+
 		if(strstr(sound_cmd, "%s"))
-			command = purple_strreplace(sound_cmd, "%s", filename);
+			command = purple_strreplace(sound_cmd, "%s", esc_filename);
 		else
-			command = g_strdup_printf("%s %s", sound_cmd, filename);
+			command = g_strdup_printf("%s %s", sound_cmd, esc_filename);
 
 		if(!g_spawn_command_line_async(command, &error)) {
 			purple_debug_error("gtksound", "sound command could not be launched: %s\n", error->message);
 			g_error_free(error);
 		}
 
+		g_free(esc_filename);
 		g_free(command);
 		return;
 	}