Woops, forgot to add this one.
This commit is contained in:
parent
c3fc72deb3
commit
3afc38f7e7
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user