summaryrefslogtreecommitdiffstats
path: root/text-utils/column.c
diff options
context:
space:
mode:
authorKarel Zak2017-05-05 11:31:47 +0200
committerKarel Zak2017-05-05 11:31:47 +0200
commitb0f00a9471b7b92b2f8680898676bb5479b97d97 (patch)
treeff13b74c8ead4f8c2dea0a5af5345eb0f3310761 /text-utils/column.c
parenttests: add new build-sys tests (diff)
downloadkernel-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.c6
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);
}
}