From c9ed1675a99a2a10eebbc2acd046aeb0e3e9fa77 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 10 Dec 2019 10:23:53 -0500 Subject: Broken --- spm.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'spm.c') diff --git a/spm.c b/spm.c index 1cfc737..9282d29 100644 --- a/spm.c +++ b/spm.c @@ -1196,7 +1196,16 @@ int init_config_global() { SPM_GLOBAL.user_config_file = get_user_config_file(); SPM_GLOBAL.package_dir = realpath(PKG_DIR, NULL); if (SPM_GLOBAL.user_config_file) { - config_read(SPM_GLOBAL.user_config_file); + SPM_GLOBAL.config = config_read(SPM_GLOBAL.user_config_file); + } +} + +void show_global_config() { + printf("configuration directory: %s\n", SPM_GLOBAL.user_config_basedir); + printf("configuration file: %s\n", SPM_GLOBAL.user_config_file); + printf("configuration:\n"); + for (int i = 0; SPM_GLOBAL.config[i] != NULL; i++) { + printf("-> %s\n", SPM_GLOBAL.config[i]); } } @@ -1205,6 +1214,10 @@ int main(int argc, char *argv[]) { // at the moment this will all be random tests, for better or worse // everything here is subject to change without notice + // Initialize configuration data + init_config_global(); + show_global_config(); + // Ensure external programs are available for use. check_runtime_environment(); -- cgit