Skip to content

Commit

Permalink
Fastfetch: don't expand envs in --config
Browse files Browse the repository at this point in the history
Since it can only be used in command line
  • Loading branch information
CarterLi committed Jan 23, 2024
1 parent 8f51763 commit 0b98a14
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/fastfetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,17 +483,16 @@ 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;
}

//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
Expand Down

0 comments on commit 0b98a14

Please sign in to comment.