Fix system-wide config file not loaded (#1121)

This commit is contained in:
Tom M 2022-06-23 20:32:29 +02:00 committed by GitHub
parent 58ec0d8eb7
commit 3a3ed4f783
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}