diff options
author | Sahan Fernando <sahan.h.fernando@gmail.com> | 2020-12-24 23:10:49 +1100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-24 20:48:54 +0100 |
commit | 12f214e2f06a85fa9f7c9e4315e60de3f13738c8 (patch) | |
tree | fe0e05f973b177549f702f43568283d21cb846e5 /Userland | |
parent | 3eeb00b003a8ee4413b09d58fd2e8de9a08a2f9c (diff) | |
download | serenity-12f214e2f06a85fa9f7c9e4315e60de3f13738c8.zip |
Userland: Make grep exit after hitting EOF on stdin
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/grep.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/grep.cpp b/Userland/grep.cpp index b06e0accfb..25ab2e900c 100644 --- a/Userland/grep.cpp +++ b/Userland/grep.cpp @@ -187,7 +187,7 @@ int main(int argc, char** argv) if (!files.size() && !recursive) { auto stdin_file = Core::File::standard_input(); - for (;;) { + while (!stdin_file->eof()) { auto line = stdin_file->read_line(); bool is_binary = line.bytes().contains_slow(0); |