mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
18 lines
506 B
C
18 lines
506 B
C
#include "os.h"
|
|
#include "common/io/io.h"
|
|
|
|
void ffDetectOSImpl(FFOSResult* os)
|
|
{
|
|
if (!ffReadFileBuffer("/etc/release", &os->prettyName))
|
|
return;
|
|
|
|
ffStrbufSubstrBeforeFirstC(&os->prettyName, '\n');
|
|
ffStrbufSubstrBeforeLastC(&os->prettyName, '(');
|
|
ffStrbufTrim(&os->prettyName, ' ');
|
|
|
|
// OpenIndiana Hipster 2024.04
|
|
uint32_t idx = ffStrbufFirstIndexC(&os->prettyName, ' ');
|
|
ffStrbufSetNS(&os->id, idx, os->prettyName.chars);
|
|
ffStrbufSetStatic(&os->idLike, "sunos");
|
|
}
|