public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] runner: Chomp away trailing spaces from cmdline
@ 2019-09-24  9:19 Chris Wilson
  2019-09-24  9:39 ` Petri Latvala
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Chris Wilson @ 2019-09-24  9:19 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

A minor refinement to remove the trailing spaces after converting the
NUL-terminators to spaces.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala@intel.com>
---
 runner/executor.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/runner/executor.c b/runner/executor.c
index 3e0121421..130ba38d2 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -630,6 +630,10 @@ static const char *get_cmdline(pid_t pid, char *buf, ssize_t len)
 		if (buf[i] == '\0')
 			buf[i] = ' ';
 
+	/* chomp away the trailing spaces */
+	while (buf[len - 1] == ' ')
+		--len;
+
 	buf[len] = '\0'; /* but make sure that we return a valid string! */
 	return buf;
 }
-- 
2.23.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-24  9:19 [igt-dev] [PATCH i-g-t] runner: Chomp away trailing spaces from cmdline Chris Wilson
2019-09-24  9:39 ` Petri Latvala
2019-09-24  9:43   ` Chris Wilson
2019-09-24 10:50 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-09-24 20:55 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox