master ohmu/fastfetch-openbsd / src / detection / os / os_sunos.c
ohmu  ·  2026-10-15
 1#include "os.h"
 2#include "common/io.h"
 3
 4void ffDetectOSImpl(FFOSResult* os) {
 5    if (!ffReadFileBuffer("/etc/release", &os->prettyName)) {
 6        return;
 7    }
 8
 9    ffStrbufSubstrBeforeFirstC(&os->prettyName, '\n');
10    ffStrbufSubstrBeforeLastC(&os->prettyName, '(');
11    ffStrbufTrim(&os->prettyName, ' ');
12
13    // OpenIndiana Hipster 2024.04
14    uint32_t idx = ffStrbufFirstIndexC(&os->prettyName, ' ');
15    ffStrbufSetNS(&os->id, idx, os->prettyName.chars);
16    ffStrbufSetStatic(&os->idLike, "sunos");
17}