aboutsummaryrefslogtreecommitdiffstats
path: root/c/cat.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--c/cat.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/c/cat.c b/c/cat.c
index dde58cd..790cb88 100644
--- a/c/cat.c
+++ b/c/cat.c
@@ -6,7 +6,8 @@ void main(void) {
if (argc > 0) {
unsigned char fd = open(argv[0], O_READ);
int ch;
- if (fd == NOFD) { puts("cat: no such file"); nl(); return; }
+ if (fd == EISDIR) { puts("cat: is a directory"); nl(); return; }
+ if (fd == NOFD) { puts("cat: no such file"); nl(); return; }
while ((ch = fgetc(fd)) >= 0) putc((char)ch);
close(fd);
} else {