From: Karel Zak Date: Thu, 3 Apr 2014 10:43:36 +0000 (+0200) Subject: fdisk: print table header as bold X-Git-Tag: v2.25-rc1~336 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fa74cb098d57a6d770e19ba361c01382c9e924c;p=thirdparty%2Futil-linux.git fdisk: print table header as bold Signed-off-by: Karel Zak --- diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c index 14f2590cfc..2283c41427 100644 --- a/disk-utils/fdisk.c +++ b/disk-utils/fdisk.c @@ -574,8 +574,20 @@ void list_disklabel(struct fdisk_context *cxt) return; if (fdisk_table_to_string(tb, cxt, NULL, 0, &str) == 0) { fputc('\n', stdout); - if (str && *str) - fputs(str, stdout); + if (str) { + char *p = str; + char *next = strchr(str, '\n'); + if (next && colors_wanted()) { + *next = '\0'; + color_enable(UL_COLOR_BOLD); + fputs(p, stdout); + color_disable(); + fputc('\n', stdout); + p = ++next; + } + fputs(p, stdout); + free(str); + } } fdisk_unref_table(tb); }