From b9dbb66bd70dc60090447fee6f568c8d4870af8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Mon, 4 Mar 2024 13:45:00 +0800 Subject: [PATCH] fastfetch: revert changes of FASTFETCH_DATATEXT_STRUCTURE Also add comments --- src/common/commandoption.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/commandoption.c b/src/common/commandoption.c index 970656389..26ceb3f5f 100644 --- a/src/common/commandoption.c +++ b/src/common/commandoption.c @@ -26,7 +26,7 @@ void ffPrepareCommandOption(FFdata* data) FFOptionsModules* const options = &instance.config.modules; //If we don't have a custom structure, use the default one if(data->structure.length == 0) - ffStrbufSetStatic(&data->structure, FASTFETCH_DATATEXT_STRUCTURE); + ffStrbufAppendS(&data->structure, FASTFETCH_DATATEXT_STRUCTURE); // Cannot use `ffStrbufSetStatic` here because we will modify the string if(ffStrbufContainIgnCaseS(&data->structure, FF_CPUUSAGE_MODULE_NAME)) ffPrepareCPUUsage(); @@ -168,7 +168,7 @@ void ffMigrateCommandOptionToJsonc(FFdata* data, yyjson_mut_doc* jsonDoc) { //If we don't have a custom structure, use the default one if(data->structure.length == 0) - ffStrbufSetStatic(&data->structure, FASTFETCH_DATATEXT_STRUCTURE); + ffStrbufAppendS(&data->structure, FASTFETCH_DATATEXT_STRUCTURE); // Cannot use `ffStrbufSetStatic` here because we will modify the string //Parse the structure and call the modules uint32_t startIndex = 0;