From ceecb39bc5f2701daf873ae40aa4cdb04fa5beb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 2 Apr 2025 23:22:04 +0800 Subject: [PATCH] WM (Linux): fix https://github.com/fastfetch-cli/fastfetch/issues/1657#issuecomment-2772749780 --- src/detection/wm/wm_linux.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/detection/wm/wm_linux.c b/src/detection/wm/wm_linux.c index 70f4ba579..42c205dce 100644 --- a/src/detection/wm/wm_linux.c +++ b/src/detection/wm/wm_linux.c @@ -31,18 +31,18 @@ static const char* getHyprland(FFstrbuf* result) FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate(); FF_DEBUG("Checking for " FASTFETCH_TARGET_DIR_USR "/include/hyprland/src/version.h" " file"); - if (ffReadFileBuffer(FASTFETCH_TARGET_DIR_USR "/include/hyprland/src/version.h", &buffer)) + if (ffReadFileBuffer(FASTFETCH_TARGET_DIR_USR "/include/hyprland/src/version.h", result)) { FF_DEBUG("Found version.h file, extracting version"); - if (ffStrbufSubstrAfterFirstS(&buffer, "\n#define GIT_TAG ")) + if (ffStrbufSubstrAfterFirstS(result, "\n#define GIT_TAG ")) { - ffStrbufSubstrAfterFirstC(&buffer, '"'); - ffStrbufSubstrBeforeFirstC(&buffer, '"'); - FF_DEBUG("Extracted version from version.h: %s", buffer.chars); + ffStrbufSubstrAfterFirstC(result, '"'); + ffStrbufSubstrBeforeFirstC(result, '"'); + FF_DEBUG("Extracted version from version.h: %s", result->chars); return NULL; } FF_DEBUG("Failed to extract version from version.h"); - ffStrbufClear(&buffer); + ffStrbufClear(result); } else {