From eb308e186113608d8d0f59184396b814eda632c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 25 Aug 2023 08:47:02 +0800 Subject: [PATCH 1/4] Memory (BSD): fix building on 32-bit FreeBSD fix #538 --- src/detection/memory/memory_bsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detection/memory/memory_bsd.c b/src/detection/memory/memory_bsd.c index e856b1256..95e587a25 100644 --- a/src/detection/memory/memory_bsd.c +++ b/src/detection/memory/memory_bsd.c @@ -3,7 +3,7 @@ const char* ffDetectMemory(FFMemoryResult* ram) { - uint64_t length = sizeof(ram->bytesTotal); + size_t length = sizeof(ram->bytesTotal); if (sysctl((int[]){ CTL_HW, HW_PHYSMEM }, 2, &ram->bytesTotal, &length, NULL, 0)) return "Failed to read hw.physmem"; From f19a3b5549738c512f264dbb960d16ca62a46043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 25 Aug 2023 09:40:36 +0800 Subject: [PATCH 2/4] Logo: fix `--file-raw` doesn't work Fix #539 Ref https://github.com/hykilpikonna/hyfetch/issues/173 --- src/logo/option.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logo/option.c b/src/logo/option.c index 6648a0d2a..59474a2d3 100644 --- a/src/logo/option.c +++ b/src/logo/option.c @@ -126,7 +126,7 @@ bool ffParseLogoCommandOptions(FFLogoOptions* options, const char* key, const ch ffOptionParseString(key, value, &options->source); options->type = FF_LOGO_TYPE_FILE; } - else if(strcasecmp(key, "raw") == 0) + else if(strcasecmp(subKey, "raw") == 0) { ffOptionParseString(key, value, &options->source); options->type = FF_LOGO_TYPE_FILE_RAW; From fe3d38e542fa0aa4570140a58d7b3b9265e91df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 25 Aug 2023 10:32:03 +0800 Subject: [PATCH 3/4] Logo: trait `-` as an alias for `/dev/stdin` which can be useful where `/dev/stdin` is not available, eg. on Windows --- src/fastfetch.c | 3 ++- src/logo/logo.c | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/fastfetch.c b/src/fastfetch.c index fd13f7862..4c947d562 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -1205,7 +1205,8 @@ static void parseArguments(FFdata* data, int argc, const char** argv) } if(i == argc - 1 || ( - *argv[i + 1] == '-' && + argv[i + 1][0] == '-' && + argv[i + 1][1] != '\0' && // `-` is used as an alias for `/dev/stdin` strcasecmp(argv[i], "--separator-string") != 0 // Separator string can start with a - )) { parseOption(data, argv[i], NULL); diff --git a/src/logo/logo.c b/src/logo/logo.c index fa074e7d6..9206a5ab1 100644 --- a/src/logo/logo.c +++ b/src/logo/logo.c @@ -359,7 +359,10 @@ static bool logoPrintFileIfExists(bool doColorReplacement, bool raw) FF_STRBUF_AUTO_DESTROY content = ffStrbufCreate(); - if(!ffAppendFileBuffer(options->source.chars, &content)) + if(ffStrbufEqualS(&options->source, "-") + ? !ffAppendFDBuffer(FFUnixFD2NativeFD(STDIN_FILENO), &content) + : !ffAppendFileBuffer(options->source.chars, &content) + ) { fprintf(stderr, "Logo: Failed to load file content from logo source: %s \n", options->source.chars); return false; From c40086615f6fe5c887dcef962c8e4e76e96061bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 25 Aug 2023 10:52:43 +0800 Subject: [PATCH 4/4] Release v2.0.4 --- CHANGELOG.md | 9 +++++++++ CMakeLists.txt | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a50d9ecb..2870f05ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# 2.0.4 + +Bugfixes: +* Fix building on 32-bit FreeBSD (Memory, BSD) +* Fix `--file-raw` doesn't work (Logo) + +Features: +* Trait `-` as an alias for `/dev/stdin`. Available for `--file`, `--file-raw` and `--raw` (Logo) + # 2.0.3 Bugfixes: diff --git a/CMakeLists.txt b/CMakeLists.txt index 829bdb7d7..d1d41f204 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url project(fastfetch - VERSION 2.0.3 + VERSION 2.0.4 LANGUAGES C DESCRIPTION "Fast system information tool" HOMEPAGE_URL "https://github.com/fastfetch-cli/fastfetch"