]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
column: parent and child has to be independent
authorKarel Zak <kzak@redhat.com>
Wed, 19 Apr 2017 11:22:31 +0000 (13:22 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 2 May 2017 10:18:00 +0000 (12:18 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
text-utils/column.c

index c22de90cee2a5fb8cafdbd7cdaf521a3364a120a..7070862448c0b78b24be91d3425372b005da1e0f 100644 (file)
@@ -329,7 +329,7 @@ static void create_tree(struct column_control *ctl)
 
                        if (!parent)
                                continue;
-                       if (strcmp(id, parent) == 0)
+                       if (strcmp(id, parent) == 0 && ln_i != ln)
                                scols_line_add_child(ln_i, ln);
                }
        }
@@ -556,7 +556,7 @@ static void __attribute__((__noreturn__)) usage(int rc)
        fputs(_(" -W, --table-wrap <columns>       wrap text in the columns when necessary\n"), out);
        fputs(_(" -J, --json                       use JSON output format for table\n"), out);
 
-       fputs(USAGE_OPTIONS, out);
+       fputs(USAGE_SEPARATOR, out);
        fputs(_(" -r, --tree <column>              column to use tree-like output for the table\n"), out);
        fputs(_(" -i, --tree-id <column>           line ID to specify child-parent relation\n"), out);
        fputs(_(" -p, --tree-parent <column>       parent to specify child-parent relation\n"), out);