Woops, forgot to add this one.

This commit is contained in:
George Fox 2023-11-07 18:52:38 +03:00
parent c3fc72deb3
commit 3afc38f7e7

View File

@ -14,13 +14,16 @@ void cat(const int fd) {
}
int main(const int argc, const char **argv) {
if (argc == 1 || argv[1][0] == '-')
if (argc == 1)
cat(STDIN_FILENO);
else {
for (int i = 1; i < argc; i++) {
if (argv[i][0] == '-')
if (argv[i][1])
break;
else
cat(STDIN_FILENO);
int fd = open(argv[i], O_RDONLY);
if (fd < 0) {