added update_gui command
[uzbl-mobile] / uzbl.c
diff --git a/uzbl.c b/uzbl.c
index e35218e..95667c6 100644 (file)
--- a/uzbl.c
+++ b/uzbl.c
@@ -821,7 +821,8 @@ struct {char *key; CommandInfo value;} cmdlist[] =
     { "keycmd_nl",          {keycmd_nl, TRUE}              },
     { "keycmd_bs",          {keycmd_bs, 0}                 },
     { "chain",              {chain, 0}                     },
-    { "print",              {print, TRUE}                  }
+    { "print",              {print, TRUE}                  },
+    { "update_gui",         {update_gui, TRUE}           }
 };
 
 void
@@ -876,6 +877,13 @@ set_var(WebKitWebView *page, GArray *argv, GString *result) {
 }
 
 void
+update_gui(WebKitWebView *page, GArray *argv, GString *result) {
+    (void) page; (void) argv; (void) result;
+
+    update_title();
+}
+
+void
 print(WebKitWebView *page, GArray *argv, GString *result) {
     (void) page; (void) result;
     gchar* buf;
@@ -1710,7 +1718,7 @@ set_var_value(gchar *name, gchar *val) {
         /* check for the variable type */
         if (c->type == TYPE_STR) {
             buf = expand(val, 0);
-            if(*c->ptr) g_free(*c->ptr);
+            g_free(*c->ptr);
             *c->ptr = buf;
         } else if(c->type == TYPE_INT) {
             int *ip = (int *)c->ptr;