From 1dbb82d25efb3cdecca5364f7715861fbca7f823 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Fri, 20 Sep 2019 14:22:14 -0500 Subject: [PATCH] trivial: fu-util-common: fix description wrapping (Fixes: #1378) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Embedded newline characters don't do so well. Before: ``` └─XPS 13 9380 System Update: New version: 0.1.3.2 Remote ID: lvfs Summary: Firmware for the Dell XPS 13 9380 License: proprietary Size: 19.9 MB Vendor: Dell Inc. Flags: is-downgrade|blocked-version Description: This stable release fixes the following issues: �� Fixed an issue with Secure Boot Option ROM Signature Verification. �� Firmware updates to address security advisory INTEL-SA-00185 (CVE-2018-12188 CVE-2018-12190 CVE-2018-12191 CVE-2018-12192 CVE-2018-12199 CVE-2018-12198 CVE-2018-12200 CVE-2018-12187 CVE-2018-12196 CVE-2018-12185). �� Firmware updates to address security advisories INTEL-SA-00191(CVE-2018-12201, CVE-2018- 12202, CVE-2018-12203, CVE-2018-12205). me new functionality has also been added: �� Removed the option Always Allow Dell Docks from BIOS settings. Dell dock connection and the port behavior will be controlled via the USB and Thunderbolt Adapter configuration settings under operating system environment. �� Replaces Absolute Software service from Computrace to Absolute Persistence Module service. �� Supports Dell Dock Station WD19. ``` After: ``` └─XPS 13 9380 System Update: New version: 0.1.3.2 Remote ID: lvfs Summary: Firmware for the Dell XPS 13 9380 License: proprietary Size: 19.9 MB Vendor: Dell Inc. Flags: is-downgrade|blocked-version Description: This stable release fixes the following issues: • Fixed an issue with Secure Boot Option ROM Signature Verification. • Firmware updates to address security advisory INTEL-SA-00185 (CVE-2018-12188 CVE-2018-12190 CVE-2018-12191 CVE-2018-12192 CVE-2018-12199 CVE-2018-12198 CVE-2018-12200 CVE-2018-12187 CVE-2018-12196 CVE-2018-12185). • Firmware updates to address security advisories INTEL-SA-00191(CVE-2018-12201, CVE-2018- 12202, CVE-2018-12203, CVE-2018-12205). Some new functionality has also been added: • Removed the option Always Allow Dell Docks from BIOS settings. Dell dock connection and the port behavior will be controlled via the USB and Thunderbolt Adapter configuration settings under operating system environment. • Replaces Absolute Software service from Computrace to Absolute Persistence Module service. • Supports Dell Dock Station WD19. ``` --- src/fu-common.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/fu-common.c b/src/fu-common.c index bcf106598..dee459d0d 100644 --- a/src/fu-common.c +++ b/src/fu-common.c @@ -1143,11 +1143,22 @@ fu_common_string_append_kv (GString *str, guint idt, const gchar *key, const gch keysz = idt * 2; } if (value != NULL) { - for (gsize i = keysz; i < align; i++) - g_string_append (str, " "); - g_string_append (str, value); + g_auto(GStrv) split = NULL; + split = g_strsplit (value, "\n", -1); + for (guint i = 0; split[i] != NULL; i++) { + if (i == 0) { + for (gsize j = keysz; j < align; j++) + g_string_append (str, " "); + } else { + for (gsize j = 0; j < idt; j++) + g_string_append (str, " "); + } + g_string_append (str, split[i]); + g_string_append (str, "\n"); + } + } else { + g_string_append (str, "\n"); } - g_string_append (str, "\n"); } void