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:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user