diff options
Diffstat (limited to 'uzbl.c')
-rw-r--r-- | uzbl.c | 37 |
1 files changed, 14 insertions, 23 deletions
@@ -123,28 +123,13 @@ static gint max_conns; static gint max_conns_host; /* --- UTILITY FUNCTIONS --- */ -void -eprint(const char *errstr, ...) { - va_list ap; - vfprintf(stderr, errstr, ap); - va_end(ap); - exit(EXIT_FAILURE); -} - -char * -estrdup(const char *str) { - void *res = strdup(str); - if(!res) - eprint("fatal: could not allocate %u bytes\n", strlen(str)); - return res; -} char * itos(int val) { char tmp[20]; snprintf(tmp, sizeof(tmp), "%i", val); - return estrdup(tmp); + return g_strdup(tmp); } /* --- CALLBACKS --- */ @@ -296,6 +281,7 @@ log_history_cb () { #define VIEWFUNC(name) static void view_##name(WebKitWebView *page, const char *param){(void)param; webkit_web_view_##name(page);} VIEWFUNC(reload) +VIEWFUNC(reload_bypass_cache) VIEWFUNC(stop_loading) VIEWFUNC(zoom_in) VIEWFUNC(zoom_out) @@ -503,6 +489,7 @@ build_stream_name(int type) { default: break; } + g_free(xwin_str); } static void @@ -590,7 +577,7 @@ control_socket(GIOChannel *chan) { buffer[strlen (buffer)] = '\0'; } close (clientsock); - ctl_line = estrdup(buffer); + ctl_line = g_strdup(buffer); parse_line (ctl_line); /* @@ -905,8 +892,8 @@ settings_init () { printf ("History handler: %s\n", (history_handler ? history_handler : "disabled")); printf ("Download manager: %s\n", (download_handler ? download_handler : "disabled")); - printf ("Fifo directory: %s\n", (fifo_dir ? fifo_dir : "/tmp")); - printf ("Socket directory: %s\n", (socket_dir ? socket_dir : "/tmp")); + printf ("Fifo directory: %s\n", (fifo_dir ? fifo_dir : "disabled")); + printf ("Socket directory: %s\n", (socket_dir ? socket_dir : "disabled")); printf ("Always insert mode: %s\n", (always_insert_mode ? "TRUE" : "FALSE")); printf ("Show status: %s\n", (show_status ? "TRUE" : "FALSE")); printf ("Status top: %s\n", (status_top ? "TRUE" : "FALSE")); @@ -1043,15 +1030,19 @@ main (int argc, char* argv[]) { if (!show_status) gtk_widget_hide(mainbar); - create_fifo (); - create_socket(); + if (fifo_dir) + create_fifo (); + if (socket_dir) + create_socket(); gtk_main (); g_string_free(keycmd, TRUE); - unlink (socket_path); - unlink (fifo_path); + if (fifo_dir) + unlink (fifo_path); + if (socket_dir) + unlink (socket_path); g_hash_table_destroy(bindings); g_hash_table_destroy(commands); |