portlist: normalise space delimited process names (#5634)

This commit is contained in:
Kristoffer Dalby
2022-09-15 12:17:31 +02:00
committed by GitHub
parent 9c6bdae556
commit 81574a5c8d
2 changed files with 19 additions and 0 deletions
+3
View File
@@ -26,6 +26,9 @@ func argvSubject(argv ...string) string {
ret = filepath.Base(argv[1])
}
// Handle space separated argv
ret, _, _ = strings.Cut(ret, " ")
// Remove common noise.
ret = strings.TrimSpace(ret)
ret = strings.TrimSuffix(ret, ".exe")