summaryrefslogtreecommitdiffstats
path: root/libsmartcols
diff options
context:
space:
mode:
authorKarel Zak2019-02-20 12:47:24 +0100
committerKarel Zak2019-02-20 12:47:24 +0100
commitebb636899096eb7062721dc49334cb023850a520 (patch)
treee92e4d8d3db89e819aae22321b3dc9c69e413875 /libsmartcols
parentlibfdisk: (dos) improve first unused sector for logical partitions (diff)
downloadkernel-qcow2-util-linux-ebb636899096eb7062721dc49334cb023850a520.tar.gz
kernel-qcow2-util-linux-ebb636899096eb7062721dc49334cb023850a520.tar.xz
kernel-qcow2-util-linux-ebb636899096eb7062721dc49334cb023850a520.zip
libsmartcols: print tree also for empty cells
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libsmartcols')
-rw-r--r--libsmartcols/src/print.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libsmartcols/src/print.c b/libsmartcols/src/print.c
index 251b211c7..a017b636b 100644
--- a/libsmartcols/src/print.c
+++ b/libsmartcols/src/print.c
@@ -548,11 +548,9 @@ int __cell_to_buffer(struct libscols_table *tb,
ce = scols_line_get_cell(ln, cl->seqnum);
data = ce ? scols_cell_get_data(ce) : NULL;
- if (!data)
- return 0;
if (!scols_column_is_tree(cl))
- return buffer_set_data(buf, data);
+ return data ? buffer_set_data(buf, data) : 0;
/*
* Group stuff
@@ -575,7 +573,7 @@ int __cell_to_buffer(struct libscols_table *tb,
if (!rc && (ln->parent || cl->is_groups) && !scols_table_is_json(tb))
buffer_set_art_index(buf);
- if (!rc)
+ if (!rc && data)
rc = buffer_append_data(buf, data);
return rc;
}