mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
Userland: Fix double line spacing in grep
This commit is contained in:
parent
3194177dce
commit
7ee73b3721
Notes:
sideshowbarker
2024-07-18 12:14:57 +09:00
Author: https://github.com/ccapitalK Commit: https://github.com/SerenityOS/serenity/commit/7ee73b37212 Pull-request: https://github.com/SerenityOS/serenity/pull/8053
1 changed files with 2 additions and 0 deletions
|
@ -177,6 +177,8 @@ int main(int argc, char** argv)
|
|||
ScopeGuard free_line = [line] { free(line); };
|
||||
while ((nread = getline(&line, &line_len, stdin)) != -1) {
|
||||
VERIFY(nread > 0);
|
||||
if (line[nread - 1] == '\n')
|
||||
--nread;
|
||||
StringView line_view(line, nread);
|
||||
bool is_binary = line_view.contains(0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue