From 5a51bd5819ff5a9a07f7c3e0ee81d6505ab9dd41 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 5 Jun 2003 00:31:03 +0000 Subject: [project @ 2003-06-05 00:31:03 by jmb] Put Choices file in Choices:NetSurf.Choices svn path=/import/netsurf/; revision=157 --- riscos/options.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'riscos') diff --git a/riscos/options.c b/riscos/options.c index 26ae0f6bc..9c02ab908 100644 --- a/riscos/options.c +++ b/riscos/options.c @@ -1,7 +1,10 @@ #include "netsurf/desktop/options.h" #include +#include #include "oslib/messagetrans.h" +#include "oslib/osfile.h" #include "netsurf/utils/log.h" +#include "netsurf/utils/utils.h" struct options OPTIONS; @@ -53,13 +56,19 @@ const char* yesno(int q) void options_write(struct options* opt, char* filename) { - char* fn; + char* fn, *dir; FILE* f; + dir = ".NetSurf"; + fn = strdup(dir); + strcat(fn, "."); + if (filename == NULL) - fn = (char*) ".Choices"; + strcat(fn, "Choices"); else - fn = filename; + strcat(fn, filename); + + xosfile_create_dir(dir, 0); f = fopen(fn, "w"); if (f != NULL) @@ -78,12 +87,14 @@ void options_write(struct options* opt, char* filename) fprintf(f, "\n# Theme\n"); fprintf(f, "RO_THEME:%s\n", opt->theme); } + + fclose(f); } void options_init(struct options* opt) { opt->http = 0; - opt->http_proxy = NULL; + opt->http_proxy = strdup("http://www-cache.freeserve.co.uk"); opt->http_port = 8080; opt->use_mouse_gestures = 0; opt->allow_text_selection = 1; @@ -101,11 +112,13 @@ void options_read(struct options* opt, char* filename) char* fn; int size; + fn = "Choices:NetSurf."; + LOG(("Testing filename")); if (filename == NULL) - fn = ".Choices"; + fn = "Choices:NetSurf.Choices"; else - fn = filename; + strcat(fn, filename); LOG(("Getting file info")); if (xmessagetrans_file_info(fn, &flags, &size) != NULL) -- cgit v1.2.3