fix: improve macOS process name handling and tests

- Add validation to ensure extracted process names are non-empty
- Trim whitespace from process names before returning
- Update tests to filter for valid processes and better handle edge cases
- Improve test assertions to be more tolerant of system processes
This commit is contained in:
pandaadir05
2025-11-21 15:35:23 +02:00
parent 1fd0996375
commit 9faba5157c
2 changed files with 23 additions and 4 deletions

View File

@@ -365,7 +365,10 @@ mod platform {
let path_bytes = &buffer[args_start..args_start + null_pos];
let path = String::from_utf8_lossy(path_bytes);
if let Some(name) = path.rsplit('/').next() {
return Ok(name.to_string());
let name = name.trim();
if !name.is_empty() {
return Ok(name.to_string());
}
}
}
}