forked from Bananymous/banan-os
Kernel: Shell cleanup cat command
This commit is contained in:
parent
f453e8e170
commit
c62849a783
|
@ -432,13 +432,8 @@ argument_done:
|
||||||
BAN::ScopeGuard _([fd] { MUST(Process::current()->close(fd)); });
|
BAN::ScopeGuard _([fd] { MUST(Process::current()->close(fd)); });
|
||||||
|
|
||||||
char buffer[1024] {};
|
char buffer[1024] {};
|
||||||
while (true)
|
while (size_t n_read = TRY(Process::current()->read(fd, buffer, sizeof(buffer))))
|
||||||
{
|
|
||||||
size_t n_read = TRY(Process::current()->read(fd, buffer, sizeof(buffer)));
|
|
||||||
if (n_read == 0)
|
|
||||||
break;
|
|
||||||
TTY_PRINT("{}", BAN::StringView(buffer, n_read));
|
TTY_PRINT("{}", BAN::StringView(buffer, n_read));
|
||||||
}
|
|
||||||
TTY_PRINTLN("");
|
TTY_PRINTLN("");
|
||||||
}
|
}
|
||||||
else if (arguments.front() == "stat")
|
else if (arguments.front() == "stat")
|
||||||
|
|
Loading…
Reference in New Issue