Skip to content

tsort: incorrectly errors on odd number of tokens per line #7077

@jfinkels

Description

@jfinkels

Environment: Ubuntu 20.04, uutils main branch (git commit 1e8e16b), GNU coreutils v8.30

Steps to reproduce:

printf "a\nb\n" | tsort

What happens now: uutils tsort terminates with an error message:

tsort: -: input contains an odd number of tokens

What I expected to happen: GNU tsort treats the pair (a, b) as an edge in the graph:

a
b

Notes: I think this is an instance where the GNU documentation could have been clearer. info tsort says, "‘tsort’ reads its input as pairs of strings, separated by blanks, indicating a partial ordering." I think the "separated by blanks" means "any whitespace".

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions