From 0b98a14977b7fbdcc64dbabd17fc5929b5ee215a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 23 Jan 2024 13:14:53 +0800 Subject: [PATCH] Fastfetch: don't expand envs in `--config` Since it can only be used in command line --- src/fastfetch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/fastfetch.c b/src/fastfetch.c index 9fdfff5137..affd59aad8 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -483,10 +483,8 @@ static void optionParseConfigFile(FFdata* data, const char* key, const char* val if(isJsonConfig ? parseJsoncFile(value) : parseConfigFile(data, value)) return; - FF_STRBUF_AUTO_DESTROY absolutePath = ffStrbufCreateA(128); - if (ffPathExpandEnv(value, &absolutePath)) { - bool success = isJsonConfig ? parseJsoncFile(absolutePath.chars) : parseConfigFile(data, absolutePath.chars); + bool success = isJsonConfig ? parseJsoncFile(value) : parseConfigFile(data, value); if(success) return; @@ -494,6 +492,7 @@ static void optionParseConfigFile(FFdata* data, const char* key, const char* val //Try to load as a relative path + FF_STRBUF_AUTO_DESTROY absolutePath = ffStrbufCreateA(128); FF_LIST_FOR_EACH(FFstrbuf, path, instance.state.platform.dataDirs) { //We need to copy it, because if a config file loads a config file, the value of path must be unchanged