aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--uzbl.c26
-rw-r--r--uzbl.h3
2 files changed, 9 insertions, 20 deletions
diff --git a/uzbl.c b/uzbl.c
index 233d5fc..c032543 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -1164,13 +1164,16 @@ cmd_modkey() {
static void
cmd_useragent() {
- char *buf;
-
- buf = set_useragent(uzbl.net.useragent);
- if(uzbl.net.useragent)
+ if (*uzbl.net.useragent == ' ') {
+ g_free (uzbl.net.useragent);
+ uzbl.net.useragent = NULL;
+ } else {
+ gchar *ua = expand_template(uzbl.net.useragent);
+ if (ua)
+ g_object_set(G_OBJECT(uzbl.net.soup_session), SOUP_SESSION_USER_AGENT, ua, NULL);
g_free(uzbl.net.useragent);
-
- uzbl.net.useragent = buf?buf:g_strdup("");
+ uzbl.net.useragent = ua;
+ }
}
static void
@@ -1837,17 +1840,6 @@ settings_init () {
g_signal_connect(n->soup_session, "request-queued", G_CALLBACK(handle_cookies), NULL);
}
-static gchar*
-set_useragent(gchar *val) {
- if (*val == ' ')
- return NULL;
-
- gchar *ua = expand_template(val);
- if (ua)
- g_object_set(G_OBJECT(uzbl.net.soup_session), SOUP_SESSION_USER_AGENT, ua, NULL);
- return ua;
-}
-
static void handle_cookies (SoupSession *session, SoupMessage *msg, gpointer user_data){
(void) session;
(void) user_data;
diff --git a/uzbl.h b/uzbl.h
index 8681667..530ca31 100644
--- a/uzbl.h
+++ b/uzbl.h
@@ -303,9 +303,6 @@ parse_cmd_line(const char *ctl_line);
static gchar*
build_stream_name(int type, const gchar *dir);
-static gchar*
-set_useragent(gchar *val);
-
static gboolean
control_fifo(GIOChannel *gio, GIOCondition condition);