aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl.c
diff options
context:
space:
mode:
authorGravatar Dieter Plaetinck <dieter@plaetinck.be>2009-06-01 00:23:28 +0200
committerGravatar Dieter Plaetinck <dieter@plaetinck.be>2009-06-01 00:23:28 +0200
commitfb4d926b1349e36bc2d3870a266d360d02d5d335 (patch)
tree01701c94034e39790840af4b79094d0c6611f8c8 /uzbl.c
parentce4ce4ad0cdb53af39092607fadc0b94e609d2e3 (diff)
fix for better uzbl.comm.sync_stdout checking + fix for libsoup-CRITICAL **: soup_message_headers_append: assertion strpbrk (value, "\r\n") == NULL' failed. basic cookies seem to be working now
Diffstat (limited to 'uzbl.c')
-rw-r--r--uzbl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/uzbl.c b/uzbl.c
index 25c3c38..9588aca 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -2235,9 +2235,13 @@ static void handle_cookies (SoupSession *session, SoupMessage *msg, gpointer use
g_string_printf(s, "GET '%s' '%s'", soup_uri->host, soup_uri->path);
run_handler(uzbl.behave.cookie_handler, s->str);
- if(uzbl.comm.sync_stdout)
- soup_message_headers_replace (msg->request_headers, "Cookie", uzbl.comm.sync_stdout);
- if (uzbl.comm.sync_stdout) uzbl.comm.sync_stdout = strfree(uzbl.comm.sync_stdout);
+ if(uzbl.comm.sync_stdout && strcmp (uzbl.comm.sync_stdout, "") != 0) {
+ char *p = strchr(uzbl.comm.sync_stdout, '\n' );
+ if ( p != NULL ) *p = '\0';
+ soup_message_headers_replace (msg->request_headers, "Cookie", (const char *) uzbl.comm.sync_stdout);
+ }
+ if (uzbl.comm.sync_stdout)
+ uzbl.comm.sync_stdout = strfree(uzbl.comm.sync_stdout);
g_string_free(s, TRUE);
}