summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorBrian Vazquez <brianvv@google.com>2019-12-04 13:32:28 -0800
committerStephen Hemminger <stephen@networkplumber.org>2019-12-05 12:19:00 -0800
commit9eee92a41ae630b2c9e92ae2875ca56801c96b73 (patch)
tree6d41d8286edf62eee3a75aaf2e033a72a2a2e4d8 /misc
parent908985c6709b6c0673501d61748c080889382d4f (diff)
downloadiproute2-9eee92a41ae630b2c9e92ae2875ca56801c96b73.tar.gz
ss: fix end-of-line printing in misc/ss.c
The previous change to ss to show header broke the printing of end-of-line for the last entry. Tested: diff <(./ss.old -nltp) <(misc/ss -nltp) 38c38 < LISTEN 0 128 [::1]:35417 [::]:* users:(("foo",pid=65254,fd=116)) \ No newline at end of file Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Diffstat (limited to 'misc')
-rw-r--r--misc/ss.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/misc/ss.c b/misc/ss.c
index c58e5c4d..95f1d37a 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -1290,6 +1290,11 @@ static void render(void)
token = buf_token_next(token);
}
+ /* Deal with final end-of-line when the last non-empty field printed
+ * is not the last field.
+ */
+ if (line_started)
+ printf("\n");
buf_free_all();
current_field = columns;