diff options
author | Karel Zak | 2017-05-05 12:13:15 +0200 |
---|---|---|
committer | Karel Zak | 2017-05-05 12:13:15 +0200 |
commit | c467fdaf8061c4a4b69a0398520a42003318e2fe (patch) | |
tree | becfad3c5d94d7fe09f5110396fe2b8a3ca9c584 | |
parent | libsmartcols: add scols_line_is_ancestor() (diff) | |
download | kernel-qcow2-util-linux-c467fdaf8061c4a4b69a0398520a42003318e2fe.tar.gz kernel-qcow2-util-linux-c467fdaf8061c4a4b69a0398520a42003318e2fe.tar.xz kernel-qcow2-util-linux-c467fdaf8061c4a4b69a0398520a42003318e2fe.zip |
column: use libsmartcols to avoid circular dependences
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | text-utils/column.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/text-utils/column.c b/text-utils/column.c index 7d6a8dcb6..4d859e013 100644 --- a/text-utils/column.c +++ b/text-utils/column.c @@ -329,12 +329,11 @@ static void create_tree(struct column_control *ctl) if (!parent) continue; - if (scols_line_get_parent(ln_i) == ln) + if (strcmp(id, parent) != 0) continue; - if ( ln_i == ln) + if (scols_line_is_ancestor(ln, ln_i)) continue; - if (strcmp(id, parent) == 0) - scols_line_add_child(ln_i, ln); + scols_line_add_child(ln_i, ln); } } |