diff options
author | Karel Zak | 2017-05-05 11:31:47 +0200 |
---|---|---|
committer | Karel Zak | 2017-05-05 11:31:47 +0200 |
commit | b0f00a9471b7b92b2f8680898676bb5479b97d97 (patch) | |
tree | ff13b74c8ead4f8c2dea0a5af5345eb0f3310761 /text-utils/column.c | |
parent | tests: add new build-sys tests (diff) | |
download | kernel-qcow2-util-linux-b0f00a9471b7b92b2f8680898676bb5479b97d97.tar.gz kernel-qcow2-util-linux-b0f00a9471b7b92b2f8680898676bb5479b97d97.tar.xz kernel-qcow2-util-linux-b0f00a9471b7b92b2f8680898676bb5479b97d97.zip |
column: fix --tree id-parent loop crash
The loop is silently ignored.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'text-utils/column.c')
-rw-r--r-- | text-utils/column.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/text-utils/column.c b/text-utils/column.c index 707086244..7d6a8dcb6 100644 --- a/text-utils/column.c +++ b/text-utils/column.c @@ -329,7 +329,11 @@ static void create_tree(struct column_control *ctl) if (!parent) continue; - if (strcmp(id, parent) == 0 && ln_i != ln) + if (scols_line_get_parent(ln_i) == ln) + continue; + if ( ln_i == ln) + continue; + if (strcmp(id, parent) == 0) scols_line_add_child(ln_i, ln); } } |