/pidgin/main: 6fd4e9f0884e: Use g_spawn_command_line_async for p...

Elliott Sales de Andrade qulogic at pidgin.im
Sat Sep 8 19:20:48 EDT 2012


Changeset: 6fd4e9f0884e18c3f8f56612f1356f51f24e9c4e
Author:	 Elliott Sales de Andrade <qulogic at pidgin.im>
Date:	 2012-09-05 03:48 -0400
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/6fd4e9f0884e

Description:

Use g_spawn_command_line_async for pounces.

diffstat:

 pidgin/gtkpounce.c |  30 ++++++------------------------
 1 files changed, 6 insertions(+), 24 deletions(-)

diffs (41 lines):

diff --git a/pidgin/gtkpounce.c b/pidgin/gtkpounce.c
--- a/pidgin/gtkpounce.c
+++ b/pidgin/gtkpounce.c
@@ -1510,31 +1510,13 @@ pounce_cb(PurplePounce *pounce, PurplePo
 
 		if (command != NULL)
 		{
-#ifndef _WIN32
-			char *localecmd = g_locale_from_utf8(command, -1, NULL,
-					NULL, NULL);
-
-			if (localecmd != NULL)
-			{
-				int pid = fork();
-
-				if (pid == 0) {
-					char *args[4];
-
-					args[0] = "sh";
-					args[1] = "-c";
-					args[2] = (char *)localecmd;
-					args[3] = NULL;
-
-					execvp(args[0], args);
-
-					_exit(0);
-				}
-				g_free(localecmd);
+			GError *error = NULL;
+			if (!g_spawn_command_line_async(command, &error)) {
+				purple_debug_error("gtkpounce",
+				                   "pounce command could not be launched: %s\n",
+				                   error->message);
+				g_error_free(error);
 			}
-#else /* !_WIN32 */
-			winpidgin_shell_execute(command, "open", NULL);
-#endif /* !_WIN32 */
 		}
 	}
 



More information about the Commits mailing list