]> git.ipfire.org Git - thirdparty/util-linux.git/commit
column: make defined separator to be non-greedy
authorSami Kerola <kerolasa@iki.fi>
Wed, 26 Sep 2012 20:45:36 +0000 (21:45 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 2 Oct 2012 08:24:48 +0000 (10:24 +0200)
commit732e3dec7d2cf7678201dc890f9b0a19fb42e6e9
tree3096398cbfcc9753febf7f6e0d69e2bff2a79732
parentf036b4c7301f858cfd945ed50f762917c0635a73
column: make defined separator to be non-greedy

This patch changes interpretation of subsequent delimeter interpretation.
Earlier version merged columns that had null string as content together,
which lead to output as visualized below.

$ printf "a:b:c\n1::3\n" | column  -t -s ':'
a  b  c
1  3

The number 3 has wrong column, which this patch takes care of, and alters
the output following way.

$ printf "a:b:c\n1::3\n" | column  -t -s ':'
a  b  c
1     3

This patch does not alter the default case, e.g., subsequent white spaces
are understood as separator of the same field, and the beginning of line
white spaces are being ignored together.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
text-utils/column.c