From: Karel Zak Date: Thu, 15 Sep 2016 10:22:12 +0000 (+0200) Subject: libsmartcols: fix tree padding X-Git-Tag: v2.29-rc1~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9aca40bbec08a15e71c56d33e7d78e6f7063ae6e;p=thirdparty%2Futil-linux.git 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 --- diff --git a/libsmartcols/src/table_print.c b/libsmartcols/src/table_print.c index 2cc817c1c1..4c9eaed65c 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);