mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 07:56:47 +01:00
Tell magic to handle errors as errors
This commit is contained in:
parent
5a5ee06407
commit
0fa26487fc
1 changed files with 2 additions and 1 deletions
|
@ -33,6 +33,7 @@ zathura_content_type_new(void)
|
||||||
#ifdef WITH_MAGIC
|
#ifdef WITH_MAGIC
|
||||||
/* creat magic cookie */
|
/* creat magic cookie */
|
||||||
static const int flags =
|
static const int flags =
|
||||||
|
MAGIC_ERROR |
|
||||||
MAGIC_MIME_TYPE |
|
MAGIC_MIME_TYPE |
|
||||||
MAGIC_SYMLINK |
|
MAGIC_SYMLINK |
|
||||||
MAGIC_NO_CHECK_APPTYPE |
|
MAGIC_NO_CHECK_APPTYPE |
|
||||||
|
@ -90,7 +91,7 @@ guess_type_magic(zathura_content_type_context_t* context, const char* path)
|
||||||
|
|
||||||
/* get the mime type */
|
/* get the mime type */
|
||||||
mime_type = magic_file(context->magic, path);
|
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));
|
girara_debug("failed guessing filetype: %s", magic_error(context->magic));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue