]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
ss: Actually print left delimiter for columns
authorStefano Brivio <sbrivio@redhat.com>
Mon, 29 Oct 2018 22:04:25 +0000 (23:04 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 31 Oct 2018 15:11:11 +0000 (08:11 -0700)
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 <yoann.p.public@gmail.com>
Fixes: 691bd854bf4a ("ss: Buffer raw fields first, then render them as a table")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Tested-by: YoyPa <yoann.p.public@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
misc/ss.c

index c8970438ce73723fba2f67e911ba9e3192ca9da1..4d12fb5d19df29e3575a3594b28dbd5ed30a7749 100644 (file)
--- 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;