diff src/sound.c @ 2478:ad4a0b3f0032

[gaim-migrate @ 2491] handle spaces better committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 10 Oct 2001 20:42:19 +0000
parents cd81f1f2c896
children 86eaeb064e82
line wrap: on
line diff
--- a/src/sound.c	Wed Oct 10 20:23:25 2001 +0000
+++ b/src/sound.c	Wed Oct 10 20:42:19 2001 +0000
@@ -398,7 +398,15 @@
 		if (sound_cmd[0]) {
 			char *args[4];
 			char command[4096];
-			g_snprintf(command, sizeof command, sound_cmd, filename);
+			char *ms;
+			if (strstr(sound_cmd, "\"%s\""))
+				g_snprintf(command, sizeof(command), sound_cmd, filename);
+			else if ((ms = strstr(sound_cmd, "%s")) != NULL) {
+				*ms = 0;
+				g_snprintf(command, sizeof(command), "%s\"%s\"%s", sound_cmd,
+						filename, ms + 2);
+			} else
+				g_snprintf(command, sizeof(command), sound_cmd);
 			args[0] = "sh";
 			args[1] = "-c";
 			args[2] = command;