From 4dd5a9c114fa5d0c8ef559bab84b51158d75ab93 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 12 Oct 2014 20:40:40 +0100 Subject: [PATCH] set defaults for cookie and url database --- monkey/dispatch.c | 4 ++-- monkey/main.c | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/monkey/dispatch.c b/monkey/dispatch.c index ba15fbd13..4329ca100 100644 --- a/monkey/dispatch.c +++ b/monkey/dispatch.c @@ -58,8 +58,8 @@ monkey_process_command(void) char **nargv; if (fgets(buffer, PATH_MAX, stdin) == NULL) { - netsurf_quit = true; - return; + /* end of input or read error so issue QUIT */ + sprintf(buffer, "QUIT\n"); } /* remove newline */ diff --git a/monkey/main.c b/monkey/main.c index 08af69405..6a7c1d663 100644 --- a/monkey/main.c +++ b/monkey/main.c @@ -86,7 +86,11 @@ static void quit_handler(int argc, char **argv) */ static nserror set_defaults(struct nsoption_s *defaults) { - /* currently no default overrides */ + /* Set defaults for absent option strings */ + nsoption_setnull_charp(cookie_file, strdup("~/.netsurf/Cookies")); + nsoption_setnull_charp(cookie_jar, strdup("~/.netsurf/Cookies")); + nsoption_setnull_charp(url_file, strdup("~/.netsurf/URLs")); + return NSERROR_OK; }