mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-16 18:35:40 +01:00
add some comments
This commit is contained in:
parent
c6c0fd1ce2
commit
4446456159
1 changed files with 7 additions and 0 deletions
|
@ -522,6 +522,8 @@ guess_type(const char* path)
|
|||
{
|
||||
#ifdef WITH_MAGIC
|
||||
const char* mime_type = NULL;
|
||||
|
||||
/* creat magic cookie */
|
||||
const int flags =
|
||||
MAGIC_MIME_TYPE |
|
||||
MAGIC_SYMLINK |
|
||||
|
@ -534,14 +536,19 @@ guess_type(const char* path)
|
|||
girara_debug("failed creating the magic cookie\n");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* ... and load mime database */
|
||||
if (magic_load(magic, NULL) < 0) {
|
||||
girara_debug("failed loading the magic database: %s\n", magic_error(magic));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* get the mime type */
|
||||
mime_type = magic_file(magic, path);
|
||||
if (mime_type == NULL) {
|
||||
girara_debug("failed guessing filetype: %s\n", magic_error(magic));
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if (magic != NULL) {
|
||||
magic_close(magic);
|
||||
|
|
Loading…
Reference in a new issue