netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2 v2] ss: fix end-of-line printing in misc/ss.c
@ 2019-12-04 21:32 Brian Vazquez
  2019-12-05 20:24 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Vazquez @ 2019-12-04 21:32 UTC (permalink / raw)
  To: Brian Vazquez, David Ahern, Stephen Hemminger
  Cc: Mahesh Bandewar, Maciej Zenczykowski, netdev, Brian Vazquez,
	Hritik Vijay, Michal Kubecek

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
---
> LISTEN   0  128   [::1]:35417  [::]:*  users:(("foo",pid=65254,fd=116))

Cc: Hritik Vijay <hritikxx8@gmail.com>
Fixes: 5883c6eba517 ("ss: show header for --processes/-p")
Signed-off-by: Brian Vazquez <brianvv@google.com>
Tested-by: Michal Kubecek <mkubecek@suse.cz>
---
 v2: Rewrote commit message as suggested by Stephen Hemminger.

 misc/ss.c | 5 +++++
 1 file changed, 5 insertions(+)

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;
-- 
2.24.0.393.g34dc348eaf-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH iproute2 v2] ss: fix end-of-line printing in misc/ss.c
  2019-12-04 21:32 [PATCH iproute2 v2] ss: fix end-of-line printing in misc/ss.c Brian Vazquez
@ 2019-12-05 20:24 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2019-12-05 20:24 UTC (permalink / raw)
  To: Brian Vazquez
  Cc: Brian Vazquez, David Ahern, Mahesh Bandewar, Maciej Zenczykowski,
	netdev, Hritik Vijay, Michal Kubecek

On Wed,  4 Dec 2019 13:32:28 -0800
Brian Vazquez <brianvv@google.com> wrote:

> 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
> ---
> > LISTEN   0  128   [::1]:35417  [::]:*  users:(("foo",pid=65254,fd=116))  
> 
> Cc: Hritik Vijay <hritikxx8@gmail.com>
> Fixes: 5883c6eba517 ("ss: show header for --processes/-p")
> Signed-off-by: Brian Vazquez <brianvv@google.com>
> Tested-by: Michal Kubecek <mkubecek@suse.cz>
> ---

Applied

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-05 20:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-04 21:32 [PATCH iproute2 v2] ss: fix end-of-line printing in misc/ss.c Brian Vazquez
2019-12-05 20:24 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).