]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libsmartcols: fix tree padding
authorKarel Zak <kzak@redhat.com>
Thu, 15 Sep 2016 10:22:12 +0000 (12:22 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 15 Sep 2016 10:22:12 +0000 (12:22 +0200)
We cannot use cell-padding char with in tree ASCII art, because
tree uses two chars rather than one.

Signed-off-by: Karel Zak <kzak@redhat.com>
libsmartcols/src/table_print.c

index 2cc817c1c1eba3aedbf2c10a0398be76bfbe4ddc..4c9eaed65c0c95967ecef6458d8328d5667f7a4f 100644 (file)
  */
 #define titlepadding_symbol(tb)        ((tb)->symbols->title_padding ? (tb)->symbols->title_padding : " ")
 #define branch_symbol(tb)      ((tb)->symbols->branch ? (tb)->symbols->branch : "|-")
-#define vertical_symbol(tb)    ((tb)->symbols->vert ? (tb)->symbols->vert : "|")
-#define right_symbol(tb)       ((tb)->symbols->right ? (tb)->symbols->right : "-")
+#define vertical_symbol(tb)    ((tb)->symbols->vert ? (tb)->symbols->vert : "| ")
+#define right_symbol(tb)       ((tb)->symbols->right ? (tb)->symbols->right : "`-")
 
 #define cellpadding_symbol(tb)  ((tb)->padding_debug ? "." : \
                                 ((tb)->symbols->cell_padding ? (tb)->symbols->cell_padding: " "))
 
-
 /* This is private struct to work with output data */
 struct libscols_buffer {
        char    *begin;         /* begin of the buffer */
@@ -186,7 +185,7 @@ static int line_ascii_art_to_buffer(struct libscols_table *tb,
                return rc;
 
        if (list_entry_is_last(&ln->ln_children, &ln->parent->ln_branch))
-               art = cellpadding_symbol(tb);
+               art = "  ";
        else
                art = vertical_symbol(tb);