summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorSahan Fernando <sahan.h.fernando@gmail.com>2020-12-24 23:10:49 +1100
committerAndreas Kling <kling@serenityos.org>2020-12-24 20:48:54 +0100
commit12f214e2f06a85fa9f7c9e4315e60de3f13738c8 (patch)
treefe0e05f973b177549f702f43568283d21cb846e5 /Userland
parent3eeb00b003a8ee4413b09d58fd2e8de9a08a2f9c (diff)
downloadserenity-12f214e2f06a85fa9f7c9e4315e60de3f13738c8.zip
Userland: Make grep exit after hitting EOF on stdin
Diffstat (limited to 'Userland')
-rw-r--r--Userland/grep.cpp2
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);