From f5e6ed4dd782e2c598f248392f6375ee8b6f48dd Mon Sep 17 00:00:00 2001 From: Miciah Dashiel Butler Masters Date: Wed, 29 Aug 2007 13:43:15 +0000 Subject: [PATCH] Drop @options parameter from create_config_string and write_config_file Hard-code it to config_options. --- src/config/cmdline.c | 2 +- src/config/conf.c | 10 +++++----- src/config/conf.h | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/config/cmdline.c b/src/config/cmdline.c index 9a36e26e8..71cd8fc50 100644 --- a/src/config/cmdline.c +++ b/src/config/cmdline.c @@ -687,7 +687,7 @@ printconfigdump_cmd(struct option *option, unsigned char ***argv, int *argc) /* Print all. */ get_opt_int("config.saving_style", NULL) = 2; - config_string = create_config_string("", "", config_options); + config_string = create_config_string("", ""); if (config_string) { printf("%s", config_string); mem_free(config_string); diff --git a/src/config/conf.c b/src/config/conf.c index 3ff8cf929..b8b82b387 100644 --- a/src/config/conf.c +++ b/src/config/conf.c @@ -693,9 +693,9 @@ add_cfg_header_to_string(struct string *string, unsigned char *text) } unsigned char * -create_config_string(unsigned char *prefix, unsigned char *name, - struct option *options) +create_config_string(unsigned char *prefix, unsigned char *name) { + struct option *options = config_options; struct string config; /* Don't write headers if nothing will be added anyway. */ struct string tmpstring; @@ -797,12 +797,12 @@ get_me_out: static int write_config_file(unsigned char *prefix, unsigned char *name, - struct option *options, struct terminal *term) + struct terminal *term) { int ret = -1; struct secure_save_info *ssi; unsigned char *config_file = NULL; - unsigned char *cfg_str = create_config_string(prefix, name, options); + unsigned char *cfg_str = create_config_string(prefix, name); int prefixlen = strlen(prefix); int prefix_has_slash = (prefixlen && dir_sep(prefix[prefixlen - 1])); int name_has_slash = dir_sep(name[0]); @@ -842,5 +842,5 @@ write_config(struct terminal *term) } return write_config_file(elinks_home, get_cmd_opt_str("config-file"), - config_options, term); + term); } diff --git a/src/config/conf.h b/src/config/conf.h index f55e4e707..f27cc896f 100644 --- a/src/config/conf.h +++ b/src/config/conf.h @@ -24,7 +24,6 @@ void parse_config_file(struct option *options, unsigned char *name, int write_config(struct terminal *); unsigned char * -create_config_string(unsigned char *prefix, unsigned char *name, - struct option *options); +create_config_string(unsigned char *prefix, unsigned char *name); #endif