1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Drop @options parameter from create_config_string and write_config_file

Hard-code it to config_options.
This commit is contained in:
Miciah Dashiel Butler Masters 2007-08-29 13:43:15 +00:00 committed by Miciah Dashiel Butler Masters
parent d1e16e1066
commit f5e6ed4dd7
3 changed files with 7 additions and 8 deletions

View File

@ -687,7 +687,7 @@ printconfigdump_cmd(struct option *option, unsigned char ***argv, int *argc)
/* Print all. */ /* Print all. */
get_opt_int("config.saving_style", NULL) = 2; get_opt_int("config.saving_style", NULL) = 2;
config_string = create_config_string("", "", config_options); config_string = create_config_string("", "");
if (config_string) { if (config_string) {
printf("%s", config_string); printf("%s", config_string);
mem_free(config_string); mem_free(config_string);

View File

@ -693,9 +693,9 @@ add_cfg_header_to_string(struct string *string, unsigned char *text)
} }
unsigned char * unsigned char *
create_config_string(unsigned char *prefix, unsigned char *name, create_config_string(unsigned char *prefix, unsigned char *name)
struct option *options)
{ {
struct option *options = config_options;
struct string config; struct string config;
/* Don't write headers if nothing will be added anyway. */ /* Don't write headers if nothing will be added anyway. */
struct string tmpstring; struct string tmpstring;
@ -797,12 +797,12 @@ get_me_out:
static int static int
write_config_file(unsigned char *prefix, unsigned char *name, write_config_file(unsigned char *prefix, unsigned char *name,
struct option *options, struct terminal *term) struct terminal *term)
{ {
int ret = -1; int ret = -1;
struct secure_save_info *ssi; struct secure_save_info *ssi;
unsigned char *config_file = NULL; 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 prefixlen = strlen(prefix);
int prefix_has_slash = (prefixlen && dir_sep(prefix[prefixlen - 1])); int prefix_has_slash = (prefixlen && dir_sep(prefix[prefixlen - 1]));
int name_has_slash = dir_sep(name[0]); 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"), return write_config_file(elinks_home, get_cmd_opt_str("config-file"),
config_options, term); term);
} }

View File

@ -24,7 +24,6 @@ void parse_config_file(struct option *options, unsigned char *name,
int write_config(struct terminal *); int write_config(struct terminal *);
unsigned char * unsigned char *
create_config_string(unsigned char *prefix, unsigned char *name, create_config_string(unsigned char *prefix, unsigned char *name);
struct option *options);
#endif #endif