summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-02-10 21:44:01 +0100
committerGitHub <noreply@github.com>2022-02-10 21:44:01 +0100
commit125556cb9847fd2c71296760d61228ad30476a8c (patch)
treed16eba0869547a574c293054972e8941c1c96c1c /src/main.c
parent617e1f3a75fedb01af851694fe31df5b859239a2 (diff)
parent26cd770c8732a4467e57cf3e7a5d4c2518836275 (diff)
Merge pull request #645 from eworm-de/magic
use libmagic to detect valid file formats
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 3d124fd..85e0504 100644
--- a/src/main.c
+++ b/src/main.c
@@ -49,6 +49,11 @@ int main(int argc, char **argv)
srandom(getpid() * time(NULL) % ((unsigned int) -1));
setup_signal_handlers();
+
+#ifdef HAVE_LIBMAGIC
+ init_magic();
+#endif
+
init_parse_options(argc, argv);
init_imlib_fonts();
@@ -262,6 +267,10 @@ void feh_clean_exit(void)
if(disp)
XCloseDisplay(disp);
+#ifdef HAVE_LIBMAGIC
+ uninit_magic();
+#endif
+
/*
* Only restore the old terminal settings if
* - we changed them in the first place