mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
Kernel: remove special handling for Windows
Since we have an implementation for it
This commit is contained in:
+4
-20
@@ -1,38 +1,22 @@
|
||||
#include "fastfetch.h"
|
||||
#include "common/printing.h"
|
||||
#include "detection/kernel/kernel.h"
|
||||
|
||||
#define FF_KERNEL_MODULE_NAME "Kernel"
|
||||
#define FF_KERNEL_NUM_FORMAT_ARGS 3
|
||||
|
||||
void ffPrintKernel(FFinstance* instance)
|
||||
{
|
||||
FFKernelResult result;
|
||||
ffDetectKernel(instance, &result);
|
||||
|
||||
if(result.error.length > 0)
|
||||
{
|
||||
ffPrintError(instance, FF_KERNEL_MODULE_NAME, 0, &instance->config.kernel, "%*s", result.error.length, result.error.chars);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if(instance->config.kernel.outputFormat.length == 0)
|
||||
{
|
||||
ffPrintLogoAndKey(instance, FF_KERNEL_MODULE_NAME, 0, &instance->config.kernel.key);
|
||||
ffStrbufPutTo(&result.release, stdout);
|
||||
puts(instance->state.utsname.release);
|
||||
}
|
||||
else
|
||||
{
|
||||
ffPrintFormat(instance, FF_KERNEL_MODULE_NAME, 0, &instance->config.kernel, FF_KERNEL_NUM_FORMAT_ARGS, (FFformatarg[]){
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &result.sysname},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &result.release},
|
||||
{FF_FORMAT_ARG_TYPE_STRBUF, &result.version}
|
||||
{FF_FORMAT_ARG_TYPE_STRING, instance->state.utsname.sysname},
|
||||
{FF_FORMAT_ARG_TYPE_STRING, instance->state.utsname.release},
|
||||
{FF_FORMAT_ARG_TYPE_STRING, instance->state.utsname.version}
|
||||
});
|
||||
}
|
||||
|
||||
exit:
|
||||
ffStrbufDestroy(&result.error);
|
||||
ffStrbufDestroy(&result.sysname);
|
||||
ffStrbufDestroy(&result.release);
|
||||
ffStrbufDestroy(&result.version);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user