fix for some commands dont have extra args
authorDieter Plaetinck <dieter@plaetinck.be>
Mon, 27 Apr 2009 18:26:51 +0000 (02:26 +0800)
committerdusanx <ef_dva@yahoo.com>
Mon, 27 Apr 2009 19:27:47 +0000 (03:27 +0800)
Signed-off-by: dusanx <ef_dva@yahoo.com>

uzbl.c

diff --git a/uzbl.c b/uzbl.c
index e55b7fe..cccfd30 100644 (file)
--- a/uzbl.c
+++ b/uzbl.c
@@ -231,7 +231,10 @@ run_command(const char *command, const char *args) {
    //command <uzbl conf> <uzbl pid> <uzbl win id> <uzbl fifo file> [args]
     GString* to_execute = g_string_new ("");
     gboolean result;
-    g_string_printf (to_execute, "%s '%s' '%i' '%i' '%s' %s", command, config_file, (int) getpid() , (int) xwin, "/tmp/uzbl_25165827", args);
+    g_string_printf (to_execute, "%s '%s' '%i' '%i' '%s'", command, config_file, (int) getpid() , (int) xwin, fifopath);
+    if(args) {
+        g_string_append_printf (to_execute, " %s", args);
+    }
     result = g_spawn_command_line_async (to_execute->str, NULL);
     printf("Called %s.  Result: %s\n", to_execute->str, (result ? "TRUE" : "FALSE" ));
     return result;