mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
Migration (Logo): fix --logo-color-num (v2)
This commit is contained in:
@@ -7,6 +7,10 @@ const char* ffJsonConfigParseEnum(yyjson_val* val, int* result, FFKeyValuePair p
|
||||
void ffPrintJsonConfig(bool prepare, yyjson_mut_doc* jsonDoc);
|
||||
void ffJsonConfigGenerateModuleArgsConfig(yyjson_mut_doc* doc, yyjson_mut_val* module, FFModuleArgs* defaultModuleArgs, FFModuleArgs* moduleArgs);
|
||||
|
||||
yyjson_api_inline yyjson_mut_val* yyjson_mut_strbuf(yyjson_mut_doc *doc, const FFstrbuf* buf) {
|
||||
return yyjson_mut_strncpy(doc, buf->chars, buf->length);
|
||||
}
|
||||
|
||||
yyjson_api_inline bool yyjson_mut_obj_add_strbuf(yyjson_mut_doc *doc,
|
||||
yyjson_mut_val *obj,
|
||||
const char *_key,
|
||||
|
||||
+4
-1
@@ -473,7 +473,10 @@ void ffOptionsGenerateLogoJsonConfig(FFOptionsLogo* options, yyjson_mut_doc* doc
|
||||
for (int i = 0; i < FASTFETCH_LOGO_MAX_COLORS; i++)
|
||||
{
|
||||
if (!ffStrbufEqual(&options->colors[i], &defaultOptions.colors[i]))
|
||||
yyjson_mut_obj_add_strbuf(doc, color, (const char [2]) { (char)('1' + i) }, &options->colors[i]);
|
||||
{
|
||||
char c = (char)('1' + i);
|
||||
yyjson_mut_obj_add(color, yyjson_mut_strncpy(doc, &c, 1), yyjson_mut_strbuf(doc, &options->colors[i]));
|
||||
}
|
||||
}
|
||||
if (yyjson_mut_obj_size(color) > 0)
|
||||
yyjson_mut_obj_add_val(doc, obj, "color", color);
|
||||
|
||||
Reference in New Issue
Block a user