btrfs-progs: string table: add specifier for fillup char
authorDavid Sterba <dsterba@suse.com>
Tue, 3 Nov 2015 00:00:23 +0000 (01:00 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 3 Nov 2015 00:00:23 +0000 (01:00 +0100)
Currently it's one by a single "=", but we might want to use
a different filler, let's make it explicit by "*".

Signed-off-by: David Sterba <dsterba@suse.com>
cmds-fi-usage.c
string-table.c

index 39b8101..3b46388 100644 (file)
@@ -729,10 +729,10 @@ static void _cmd_filesystem_usage_tabular(unsigned unit_mode,
                if (sargs->spaces[i].flags & BTRFS_SPACE_INFO_GLOBAL_RSV)
                        continue;
 
-               table_printf(matrix, col++, vhdr_skip + device_info_count, "=");
+               table_printf(matrix, col++, vhdr_skip + device_info_count, "*=");
        }
        /* One for Unallocated */
-       table_printf(matrix, col, vhdr_skip + device_info_count, "=");
+       table_printf(matrix, col, vhdr_skip + device_info_count, "*=");
 
        /* footer */
        table_printf(matrix, 1, vhdr_skip + device_info_count + 1, "<Total");
index 2d05e4d..7e01412 100644 (file)
@@ -101,7 +101,7 @@ void table_dump(struct string_table *tab)
                                continue;
 
                        len = strlen(tab->cells[idx]) - 1;
-                       if (len < 1 || tab->cells[idx][0] == '=')
+                       if (len < 1 || tab->cells[idx][0] == '*')
                                continue;
 
                        if (len > sizes[i])
@@ -116,11 +116,11 @@ void table_dump(struct string_table *tab)
 
                        if (!cell || !strlen(cell)) {
                                printf("%*s", sizes[i], "");
-                       } else if (cell && cell[0] == '=') {
+                       } else if (cell && cell[0] == '*' && cell[1]) {
                                int k = sizes[i];
 
                                while (k--)
-                                       putchar('=');
+                                       putchar(cell[1]);
                        } else {
                                printf("%*s",
                                        cell[0] == '<' ? -sizes[i] : sizes[i],