summaryrefslogtreecommitdiffstats
path: root/commands/filetype.c
diff options
context:
space:
mode:
Diffstat (limited to 'commands/filetype.c')
-rw-r--r--commands/filetype.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/commands/filetype.c b/commands/filetype.c
index 818c14fe79..7a556a980d 100644
--- a/commands/filetype.c
+++ b/commands/filetype.c
@@ -66,7 +66,11 @@ static int do_filetype(int argc, char *argv[])
if (S_ISDIR(s.st_mode))
return -EISDIR;
- type = file_name_detect_type(filename);
+ ret = file_name_detect_type(filename, &type);
+ if (ret) {
+ printf("failed to detect type of %s: %s\n", filename, strerror(-ret));
+ return COMMAND_ERROR;
+ }
if (verbose)
printf("%s: %s (%s)\n", filename,