mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-13 08:03:45 +01:00
Tell magic to handle errors as errors
This commit is contained in:
parent
5a5ee06407
commit
0fa26487fc
@ -33,6 +33,7 @@ zathura_content_type_new(void)
|
||||
#ifdef WITH_MAGIC
|
||||
/* creat magic cookie */
|
||||
static const int flags =
|
||||
MAGIC_ERROR |
|
||||
MAGIC_MIME_TYPE |
|
||||
MAGIC_SYMLINK |
|
||||
MAGIC_NO_CHECK_APPTYPE |
|
||||
@ -90,7 +91,7 @@ guess_type_magic(zathura_content_type_context_t* context, const char* path)
|
||||
|
||||
/* get the mime type */
|
||||
mime_type = magic_file(context->magic, path);
|
||||
if (mime_type == NULL) {
|
||||
if (mime_type == NULL || magic_errno(context->magic) != 0) {
|
||||
girara_debug("failed guessing filetype: %s", magic_error(context->magic));
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user