From c62849a783b5330c860d4fff32a066ba47dc59a3 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sat, 1 Apr 2023 00:54:39 +0300 Subject: [PATCH] Kernel: Shell cleanup cat command --- kernel/kernel/Shell.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/kernel/kernel/Shell.cpp b/kernel/kernel/Shell.cpp index aea1e1c8..4716fd8c 100644 --- a/kernel/kernel/Shell.cpp +++ b/kernel/kernel/Shell.cpp @@ -432,13 +432,8 @@ argument_done: BAN::ScopeGuard _([fd] { MUST(Process::current()->close(fd)); }); char buffer[1024] {}; - while (true) - { - size_t n_read = TRY(Process::current()->read(fd, buffer, sizeof(buffer))); - if (n_read == 0) - break; + while (size_t n_read = TRY(Process::current()->read(fd, buffer, sizeof(buffer)))) TTY_PRINT("{}", BAN::StringView(buffer, n_read)); - } TTY_PRINTLN(""); } else if (arguments.front() == "stat")