From: Stefano Brivio Date: Mon, 29 Oct 2018 22:04:25 +0000 (+0100) Subject: ss: Actually print left delimiter for columns X-Git-Tag: v4.20.0~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00240899ec0b0bb296ee54860802adec3be0d26e;p=thirdparty%2Fiproute2.git ss: Actually print left delimiter for columns While rendering columns, we use a local variable to keep track of the field currently being printed, without touching current_field, which is used for buffering. Use the right pointer to access the left delimiter for the current column, instead of always printing the left delimiter for the last buffered field, which is usually an empty string. This fixes an issue especially visible on narrow terminals, where some columns might be displayed without separation. Reported-by: YoyPa Fixes: 691bd854bf4a ("ss: Buffer raw fields first, then render them as a table") Signed-off-by: Stefano Brivio Tested-by: YoyPa Signed-off-by: Stephen Hemminger --- diff --git a/misc/ss.c b/misc/ss.c index c8970438c..4d12fb5d1 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -1260,7 +1260,7 @@ static void render(void) while (token) { /* Print left delimiter only if we already started a line */ if (line_started++) - printed = printf("%s", current_field->ldelim); + printed = printf("%s", f->ldelim); else printed = 0;