merged from barrucadu
authorDieter Plaetinck <dieter@plaetinck.be>
Wed, 29 Apr 2009 19:50:32 +0000 (21:50 +0200)
committerDieter Plaetinck <dieter@plaetinck.be>
Wed, 29 Apr 2009 19:50:32 +0000 (21:50 +0200)
1  2 
TODO
examples/scripts/load_url_from_bookmarks.sh
examples/scripts/load_url_from_history.sh
uzbl.c

diff --cc TODO
Simple merge
@@@ -9,4 -9,4 +9,5 @@@ els
  fi
  
  goto=`awk '{print $1}' $file | dmenu -i` #NOTE: it's the job of the script that inserts bookmarks to make sure there are no dupes.
- [ -n "$goto" ] && echo "uri $goto" > $4
++#[ -n "$goto" ] && echo "uri $goto" > $4
+ [ -n "$goto" ] && uzblctrl -s $4 -c "uri $goto"
@@@ -3,4 -3,4 +3,5 @@@
  history_file=/tmp/uzbl.history
  
  goto=`awk '{print $3}' $history_file | sort | uniq | dmenu -i`
- [ -n "$goto" ] && echo "uri $goto" > $4
++#[ -n "$goto" ] && echo "uri $goto" > $4
+ [ -n "$goto" ] && uzblctrl -s $4 -c "uri $goto"
diff --cc uzbl.c
--- 1/uzbl.c
--- 2/uzbl.c
+++ b/uzbl.c
@@@ -356,31 -360,30 +360,31 @@@ run_command(const char *command, const 
  
  static void
  parse_command(const char *cmd) {
-   Command *c = NULL;
-   char buffer[512];
-   strcpy (buffer, cmd);
-   char * saveptr;
-   char * command_name  = strtok_r (buffer, " ", &saveptr);
-   gchar * command_param = strtok_r (NULL,  " ,", &saveptr);
+     Command *c = NULL;
+     char buffer[512];
+     strcpy (buffer, cmd);
 -    char * command_name  = strtok (buffer, " ");
 -    gchar * command_param = strtok (NULL,  " ,");
++    char * saveptr;
++    char * command_name  = strtok_r (buffer, " ", &saveptr);
++    gchar * command_param = strtok_r (NULL,  " ,", &saveptr);
    
-   if((c = g_hash_table_lookup(commands, command_name)) != NULL){
-     if (c->func_2_params != NULL) {
-       if (command_param != NULL) {
-       printf ("command executing: \"%s %s\"\n", command_name, command_param);
-       c->func_2_params (web_view, command_param);
-       } else {
-       if (c->func_1_param != NULL) {
-         printf ("command executing: \"%s\"\n", command_name);
-         c->func_1_param (web_view);
-       } else 
-         fprintf (stderr, "command needs a parameter. \"%s\" is not complete\n", command_name);
-       }
-     } else if (c->func_1_param != NULL) {
-       printf ("command executing: \"%s\"\n", command_name);
-       c->func_1_param (web_view);
-     }
-   } else
-     fprintf (stderr, "command \"%s\" not understood. ignoring.\n", cmd);
+     if((c = g_hash_table_lookup(commands, command_name)) != NULL){
+         if (c->func_2_params != NULL) {
+             if (command_param != NULL) {
+               printf ("command executing: \"%s %s\"\n", command_name, command_param);
+               c->func_2_params (web_view, command_param);
+             } else {
+                 if (c->func_1_param != NULL) {
+                   printf ("command executing: \"%s\"\n", command_name);
+                   c->func_1_param (web_view);
+                 } else 
+                     fprintf (stderr, "command needs a parameter. \"%s\" is not complete\n", command_name);
+             }
+         } else if (c->func_1_param != NULL) {
+             printf ("command executing: \"%s\"\n", command_name);
+             c->func_1_param (web_view);
+         }
+     } else
+         fprintf (stderr, "command \"%s\" not understood. ignoring.\n", cmd);
  }
  
  static void
@@@ -472,17 -507,17 +508,17 @@@ key_press_cb (WebKitWebView* page, GdkE
  
      //INTERNAL BINDINGS
      if((act = g_hash_table_lookup(internal_bindings, event->string)) != NULL)
-       if (!insert_mode || (event->state == modmask)) {
-       parse_command (act);
-       result = TRUE;
-       }
+         if (!insert_mode || (event->state == modmask)) {
+             parse_command (act);
+             result = TRUE;
+         }
+     
      //EXTERNAL BINDINGS
      if((act = g_hash_table_lookup(external_bindings, event->string)) != NULL)
-       if (!insert_mode || (event->state == modmask)) {
-       run_command (act, NULL);
-       result = TRUE;
-       }
+         if (!insert_mode || (event->state == modmask)) {
 -            run_command(act, NULL);
++            run_command (act, NULL);
+             result = TRUE;
+         }
      
      if (!result)
          result = (insert_mode ? FALSE : TRUE);