From 9aca40bbec08a15e71c56d33e7d78e6f7063ae6e Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 15 Sep 2016 12:22:12 +0200 Subject: [PATCH] libsmartcols: fix tree padding We cannot use cell-padding char with in tree ASCII art, because tree uses two chars rather than one. Signed-off-by: Karel Zak --- libsmartcols/src/table_print.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libsmartcols/src/table_print.c b/libsmartcols/src/table_print.c index 2cc817c1c..4c9eaed65 100644 --- a/libsmartcols/src/table_print.c +++ b/libsmartcols/src/table_print.c @@ -37,13 +37,12 @@ */ #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);