From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Brivio Subject: [PATCH iproute] ss: Actually print left delimiter for columns Date: Mon, 29 Oct 2018 23:04:25 +0100 Message-ID: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: "Yoann P." , netdev@vger.kernel.org To: Stephen Hemminger Return-path: Received: from mx1.redhat.com ([209.132.183.28]:40178 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727719AbeJ3GzV (ORCPT ); Tue, 30 Oct 2018 02:55:21 -0400 Sender: netdev-owner@vger.kernel.org List-ID: 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 --- misc/ss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/ss.c b/misc/ss.c index c8970438ce73..4d12fb5d19df 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; -- 2.19.1