merge in Duclares stuff
authorDieter Plaetinck <dieter@plaetinck.be>
Sat, 16 May 2009 14:24:59 +0000 (16:24 +0200)
committerDieter Plaetinck <dieter@plaetinck.be>
Sat, 16 May 2009 14:24:59 +0000 (16:24 +0200)
1  2 
uzbl.c
uzbl.h

diff --cc uzbl.c
--- 1/uzbl.c
--- 2/uzbl.c
+++ b/uzbl.c
@@@ -716,30 -711,16 +716,16 @@@ run_command (const char *command, cons
      GString* to_execute = g_string_new ("");
      gboolean result;
      g_string_printf (to_execute, "%s '%s' '%i' '%i' '%s' '%s'", 
-                     command, uzbl.state.config_file, (int) getpid() ,
-                     (int) uzbl.xwin, uzbl.comm.fifo_path, uzbl.comm.socket_path);
+                      command, (uzbl.state.config_file ? uzbl.state.config_file : "(null)"),
+                      (int) getpid(), (int) uzbl.xwin, uzbl.comm.fifo_path,
+                      uzbl.comm.socket_path);
      g_string_append_printf (to_execute, " '%s' '%s'", 
 -                    uzbl.state.uri, "TODO title here");
 +                    uzbl.state.uri, uzbl.gui.main_title);
-     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" ));
-     g_string_free (to_execute, TRUE);
-     return result;
- }
+     if(args) g_string_append_printf (to_execute, " %s", args);
  
- static gboolean
- run_command_sync(const char *command, const char *args, char **stdout) {
-       //command <uzbl conf> <uzbl pid> <uzbl win id> <uzbl fifo file> <uzbl socket file> [args]
-     GString* to_execute = g_string_new ("");
-     gboolean result;
-     g_string_printf (to_execute, "%s '%s' '%i' '%i' '%s' '%s'", command, uzbl.state.config_file, (int) getpid() , (int) uzbl.xwin, uzbl.comm.fifo_path, uzbl.comm.socket_path);
-     g_string_append_printf (to_execute, " '%s' '%s'", uzbl.state.uri, uzbl.gui.main_title);
-     if(args) {
-         g_string_append_printf (to_execute, " %s", args);
-     }
-     result = g_spawn_command_line_sync (to_execute->str, stdout, NULL, NULL, NULL);
+     if (sync) {
+         result = g_spawn_command_line_sync (to_execute->str, stdout, NULL, NULL, NULL);
+     } else result = g_spawn_command_line_async (to_execute->str, NULL);
      printf("Called %s.  Result: %s\n", to_execute->str, (result ? "TRUE" : "FALSE" ));
      g_string_free (to_execute, TRUE);
      return result;
diff --cc uzbl.h
Simple merge