Skip to content

Commit 43b3998

Browse files
Fix bedrock linux detection
1 parent c55cc9c commit 43b3998

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/detection/os.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
#if !defined(__ANDROID__)
77

8-
static void parseFile(const char* fileName, FFOSResult* result)
8+
static bool parseFile(const char* fileName, FFOSResult* result)
99
{
1010
if(result->id.length > 0 && result->name.length > 0 && result->prettyName.length > 0)
11-
return;
11+
return true;
1212

13-
ffParsePropFileValues(fileName, 13, (FFpropquery[]) {
13+
return ffParsePropFileValues(fileName, 13, (FFpropquery[]) {
1414
{"NAME =", &result->name},
1515
{"DISTRIB_DESCRIPTION =", &result->prettyName},
1616
{"PRETTY_NAME =", &result->prettyName},
@@ -124,9 +124,8 @@ const FFOSResult* ffDetectOS(const FFinstance* instance)
124124
{
125125
parseFile(instance->config.osFile.chars, &result);
126126
}
127-
else if(instance->config.escapeBedrock && ffFileExists(FASTFETCH_TARGET_DIR_ROOT"/bedrock/etc/bedrock-release", S_IFDIR)) {
128-
parseFile(FASTFETCH_TARGET_DIR_ROOT"/bedrock/etc/bedrock-release", &result);
129-
127+
else if(instance->config.escapeBedrock && parseFile(FASTFETCH_TARGET_DIR_ROOT"/bedrock/etc/bedrock-release", &result))
128+
{
130129
if(result.id.length == 0)
131130
ffStrbufAppendS(&result.id, "bedrock");
132131

0 commit comments

Comments
 (0)