mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 16:26:39 +01:00
Config: search for user config file in the order of configDirs
This is necessary to keep forward compatibility for Windows / macOS users. Since `$LOCALAPPPATH` and `~/Library/Preferences` are now the first element of `configDirs`, config files in `~/.config` won't be used in previous manner.
This commit is contained in:
+9
-5
@@ -1312,14 +1312,18 @@ static void parseConfigFileUser(FFinstance* instance, FFdata* data)
|
||||
if(!data->loadUserConfig)
|
||||
return;
|
||||
|
||||
FFstrbuf* filename = ffListGet(&instance->state.configDirs, 0);
|
||||
uint32_t filenameLength = filename->length;
|
||||
FF_LIST_FOR_EACH(FFstrbuf, filename, instance->state.configDirs)
|
||||
{
|
||||
uint32_t filenameLength = filename->length;
|
||||
|
||||
ffStrbufAppendS(filename, "fastfetch/config.conf");
|
||||
ffStrbufAppendS(filename, "fastfetch/config.conf");
|
||||
|
||||
parseConfigFile(instance, data, filename->chars);
|
||||
bool found = parseConfigFile(instance, data, filename->chars);
|
||||
|
||||
ffStrbufSubstrBefore(filename, filenameLength);
|
||||
ffStrbufSubstrBefore(filename, filenameLength);
|
||||
|
||||
if(found) break;
|
||||
}
|
||||
}
|
||||
|
||||
static void parseArguments(FFinstance* instance, FFdata* data, int argc, const char** argv)
|
||||
|
||||
Reference in New Issue
Block a user