Fix bedrock linux detection

This commit is contained in:
Linus Dierheimer
2022-06-03 01:48:50 +02:00
parent c55cc9c732
commit 43b3998b9d
+5 -6
View File
@@ -5,12 +5,12 @@
#if !defined(__ANDROID__)
static void parseFile(const char* fileName, FFOSResult* result)
static bool parseFile(const char* fileName, FFOSResult* result)
{
if(result->id.length > 0 && result->name.length > 0 && result->prettyName.length > 0)
return;
return true;
ffParsePropFileValues(fileName, 13, (FFpropquery[]) {
return ffParsePropFileValues(fileName, 13, (FFpropquery[]) {
{"NAME =", &result->name},
{"DISTRIB_DESCRIPTION =", &result->prettyName},
{"PRETTY_NAME =", &result->prettyName},
@@ -124,9 +124,8 @@ const FFOSResult* ffDetectOS(const FFinstance* instance)
{
parseFile(instance->config.osFile.chars, &result);
}
else if(instance->config.escapeBedrock && ffFileExists(FASTFETCH_TARGET_DIR_ROOT"/bedrock/etc/bedrock-release", S_IFDIR)) {
parseFile(FASTFETCH_TARGET_DIR_ROOT"/bedrock/etc/bedrock-release", &result);
else if(instance->config.escapeBedrock && parseFile(FASTFETCH_TARGET_DIR_ROOT"/bedrock/etc/bedrock-release", &result))
{
if(result.id.length == 0)
ffStrbufAppendS(&result.id, "bedrock");