mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:04:59 +00:00
Utilities: Allow for white spaces in lsof name parsing
Previously lsof would crash by incorrectly parsing valid file names that contain spaces. For example, established TCP socket file descriptors would cause an lsof crash: socket:127.0.0.1:33985 / 127.0.0.1:8080 (connected) This commit fixes the issue by not parsing for white spaces to set the file name.
This commit is contained in:
parent
36e7733dec
commit
b985eb1613
1 changed files with 1 additions and 1 deletions
|
@ -38,7 +38,7 @@ static bool parse_name(StringView name, OpenFile& file)
|
|||
return true;
|
||||
} else {
|
||||
file.type = component1;
|
||||
auto component2 = lexer.consume_while([](char c) { return isprint(c) && !isspace(c) && c != '('; });
|
||||
auto component2 = lexer.consume_while([](char c) { return isprint(c) && c != '('; });
|
||||
lexer.ignore_while(isspace);
|
||||
file.name = component2;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue