changeset 3417:68fdee3dd3ef

[gaim-migrate @ 3436] That was so broken. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Thu, 22 Aug 2002 03:13:39 +0000
parents bfb951e56c12
children 0d1af9166119
files src/browser.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/browser.c	Thu Aug 22 00:45:49 2002 +0000
+++ b/src/browser.c	Thu Aug 22 03:13:39 2002 +0000
@@ -636,7 +636,8 @@
 		if (pid == 0) {
 			char *args[4];
 			char command[1024];
-			
+			char *quoted = NULL;
+
 			if (web_browser == BROWSER_OPERA) {
 				args[0] = "opera";
 				args[1] = "-newwindow";
@@ -662,16 +663,17 @@
 				args[1] = url;
 				args[2] = NULL;
 			} else if (web_browser == BROWSER_MANUAL) {
-				char *quoted = g_shell_quote(command);
 				g_snprintf(command, sizeof(command), web_command, quoted);
-				g_free(quoted);
+				quoted = g_shell_quote(command);
 				args[0] = "sh";
 				args[1] = "-c";
-				args[2] = command;
+				args[2] = quoted;
 				args[3] = NULL;
 			}
 
 			execvp(args[0], args);
+			if (quoted)
+				g_free(quoted);
 			_exit(0);
 		}
 	}