From 09bb322d7e6afe57e287ce173a7a0891c7058920 Mon Sep 17 00:00:00 2001 From: mk-pmb Date: Fri, 10 Oct 2014 13:30:17 +0200 Subject: [PATCH] When creating a new config, determine config dir by default strategy. --- main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 8bdfacd..4e43f91 100644 --- a/main.c +++ b/main.c @@ -239,11 +239,15 @@ void check_type_sizes (void) { void running_for_first_time (void) { check_type_sizes (); - if (config_filename) { + if (!str_empty (config_filename)) { return; // Do not create custom config file } - tasprintf (&config_filename, "%s/%s/%s", get_home_directory (), CONFIG_DIRECTORY, CONFIG_FILE); + if (str_empty (config_directory)) { + config_directory = get_config_directory (); + } + tasprintf (&config_filename, "%s/%s", config_directory, CONFIG_FILE); config_filename = make_full_path (config_filename); + // printf ("I: config file=[%s]\n", config_filename); int config_file_fd; char *config_directory = get_config_directory ();