Fastfetch: don't use invalid paths when printing preset files

This commit is contained in:
Carter Li
2024-10-15 10:31:37 +08:00
parent 21ab56ad00
commit d6fa03d9e6
+7 -4
View File
@@ -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)