diff options
Diffstat (limited to 'src/tak.c')
-rw-r--r-- | src/tak.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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; } |