From 325bfd53e889fd52f240e4bcbd690b03dddc7570 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Mon, 29 Jul 2019 01:24:29 +0000 Subject: column: fix outputing empty column at the end of line The following commands manifests the problem. In old versions before commit 4762ae9d60 ("column: use libsmartcols for --table"), both of them should output with 2 "|" echo '||' | column -o '|' -s '|' -t echo '|| ' | column -o '|' -s '|' -t Fixes: 4762ae9d60 ("column: use libsmartcols for --table") Signed-off-by: Yousong Zhou Reviewed-by: Sami Kerola --- text-utils/column.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'text-utils') diff --git a/text-utils/column.c b/text-utils/column.c index 13b39537e..9d56e514c 100644 --- a/text-utils/column.c +++ b/text-utils/column.c @@ -169,7 +169,7 @@ static wchar_t *local_wcstok(wchar_t *p, const wchar_t *separator, int greedy, w return strtok_r(p, separator, state); #endif if (!p) { - if (!*state || !**state) + if (!*state) return NULL; p = *state; } -- cgit v1.2.3-55-g7522