summaryrefslogtreecommitdiff
path: root/src/tak.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tak.c')
-rw-r--r--src/tak.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/tak.c b/src/tak.c
index 8ae6ca5..e0c501f 100644
--- a/src/tak.c
+++ b/src/tak.c
@@ -82,11 +82,13 @@ int entry_tak(int argc, char **argv) {
if (!strcmp(*args, "-")) {
fb = stream_to_filebuf(stdin, 0);
if (fb == NULL) goto err_stdin;
+ } else {
+ bool isdir = false;
+ fb = file_to_filebuf(*args, 0, &isdir);
+ if (isdir) goto err_isdir;
+ else if (fb == NULL) goto err_file;
}
- if (fb == NULL) fb = file_to_filebuf(*args, 0);
-
- if (fb == NULL) goto err_file;
process(fb);
args++;
@@ -101,4 +103,8 @@ err_stdin:
err_file:
fprintf(stderr, "tak: fout bij lezen van bestand\n");
return 1;
+
+err_isdir:
+ fprintf(stderr, "tak: bestand '%s' is een mapje\n", *args);
+ return 1;
}