From fb4d926b1349e36bc2d3870a266d360d02d5d335 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Mon, 1 Jun 2009 00:23:28 +0200 Subject: 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 --- uzbl.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'uzbl.c') 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); } -- cgit v1.2.3