mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Fastfetch: don't use invalid paths when printing preset files
This commit is contained in:
+7
-4
@@ -266,10 +266,13 @@ static void listAvailablePresets(bool pretty)
|
||||
ffListFilesRecursively(path->chars, pretty);
|
||||
}
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY absolutePath = ffStrbufCreateCopy(&instance.state.platform.exePath);
|
||||
ffStrbufSubstrBeforeLastC(&absolutePath, '/');
|
||||
ffStrbufAppendS(&absolutePath, "/presets/");
|
||||
ffListFilesRecursively(absolutePath.chars, pretty);
|
||||
if (instance.state.platform.exePath.length)
|
||||
{
|
||||
FF_STRBUF_AUTO_DESTROY absolutePath = ffStrbufCreateCopy(&instance.state.platform.exePath);
|
||||
ffStrbufSubstrBeforeLastC(&absolutePath, '/');
|
||||
ffStrbufAppendS(&absolutePath, "/presets/");
|
||||
ffListFilesRecursively(absolutePath.chars, pretty);
|
||||
}
|
||||
}
|
||||
|
||||
static void listAvailableLogos(void)
|
||||
|
||||
Reference in New Issue
Block a user