From 3a3ed4f783d3a8df6d36edee73a07684304185c6 Mon Sep 17 00:00:00 2001 From: Tom M Date: Thu, 23 Jun 2022 20:32:29 +0200 Subject: [PATCH] Fix system-wide config file not loaded (#1121) --- src/fluidsynth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fluidsynth.c b/src/fluidsynth.c index ea383d79..beb917fd 100644 --- a/src/fluidsynth.c +++ b/src/fluidsynth.c @@ -891,13 +891,13 @@ int main(int argc, char **argv) if(config_file == NULL) { config_file = fluid_get_userconf(buf, sizeof(buf)); - if(config_file == NULL) + if(config_file == NULL || !g_file_test(config_file, G_FILE_TEST_EXISTS)) { config_file = fluid_get_sysconf(buf, sizeof(buf)); } /* if the automatically selected command file does not exist, do not even attempt to open it */ - if(!g_file_test(config_file, G_FILE_TEST_EXISTS)) + if(config_file != NULL && !g_file_test(config_file, G_FILE_TEST_EXISTS)) { config_file = NULL; }