]> git.ipfire.org Git - thirdparty/util-linux.git/commit
column: fix greedy mode on -l
authorKarel Zak <kzak@redhat.com>
Thu, 4 Aug 2022 08:13:49 +0000 (10:13 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 4 Aug 2022 08:13:49 +0000 (10:13 +0200)
commitac1f3857366ae2273a428f05a7c4a0ad7816509c
tree1b6a60699dbbc84ec8c8a6df765cfdb7e3be5023
parent0763e8dd609b5061f04f2d7d592d0374e3d10688
column: fix greedy mode on -l

In the 'greedy' mode strtok() skips leading white chars, but code for
-l (merge remaining data to the last column) do not count the skipped
chars.

Old version:

$ printf '  a b c\n1 2 3\n' | column -t -o '-' -l2
a-a
1-2 3

Fixed version:

$ printf '  a b c\n1 2 3\n' | column -t -o '-' -l2
a-b c
1-2 3

Note, see leading white chars '  a b c'.

Fexes: https://github.com/util-linux/util-linux/issues/1763
Signed-off-by: Karel Zak <kzak@redhat.com>
text-utils/column.c