]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lspcu: Print dummy modelname if none present
authorThomas Weißschuh <thomas@t-8ch.de>
Sat, 15 Jan 2022 08:54:08 +0000 (09:54 +0100)
committerThomas Weißschuh <thomas@t-8ch.de>
Sat, 15 Jan 2022 08:59:54 +0000 (09:59 +0100)
The logic in print_summary_cputype() starts a new hierarchy level under
the CPUs "Model name" entry. If the model is unknown the hierarchy level
will be skipped. This is visually confusing in the human-readable
version and changes the schema of the JSON tree.

sys-utils/lscpu.c

index e11b2f42f08e5881bb48d81a7c4358560e76abe7..32f989e381c39015120e62ef499095abad687191 100644 (file)
@@ -859,8 +859,7 @@ print_summary_cputype(struct lscpu_cxt *cxt,
                     struct libscols_table *tb,
                     struct libscols_line *sec)
 {
-       if (ct->modelname)
-               sec = add_summary_s(tb, sec, _("Model name:"), ct->modelname);
+       sec = add_summary_s(tb, sec, _("Model name:"), ct->modelname ? ct->modelname : "-");
        if (ct->bios_modelname)
                add_summary_s(tb, sec, _("BIOS Model name:"), ct->bios_modelname);
        if (ct->bios_family)