From 43b3998b9d61d43a2febd1e77b85e154fcda1540 Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Fri, 3 Jun 2022 01:48:50 +0200 Subject: [PATCH] Fix bedrock linux detection --- src/detection/os.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/detection/os.c b/src/detection/os.c index bb09e8db7..abe4eff33 100644 --- a/src/detection/os.c +++ b/src/detection/os.c @@ -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");