summaryrefslogtreecommitdiffstats
path: root/disk-utils/fdisk.c
diff options
context:
space:
mode:
authorKarel Zak2014-04-03 12:43:36 +0200
committerKarel Zak2014-04-03 12:43:36 +0200
commit7fa74cb098d57a6d770e19ba361c01382c9e924c (patch)
treeeb0824d42a1f9c71fe7296d96f38856ecb60a740 /disk-utils/fdisk.c
parentlibfdisk: fix freesapce detection for nested partitions (diff)
downloadkernel-qcow2-util-linux-7fa74cb098d57a6d770e19ba361c01382c9e924c.tar.gz
kernel-qcow2-util-linux-7fa74cb098d57a6d770e19ba361c01382c9e924c.tar.xz
kernel-qcow2-util-linux-7fa74cb098d57a6d770e19ba361c01382c9e924c.zip
fdisk: print table header as bold
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/fdisk.c')
-rw-r--r--disk-utils/fdisk.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c
index 14f2590cf..2283c4142 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);
}