From 1dd2430554d7789d1866016a46f56b6ec41dcb83 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Thu, 22 Mar 2012 16:28:36 +0100 Subject: [PATCH] If g_content_type_guess is certain, stop early. --- document.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/document.c b/document.c index 263b90a..f938adb 100644 --- a/document.c +++ b/document.c @@ -181,6 +181,10 @@ guess_type(const char* path) return NULL; } + if (uncertain == FALSE) { + return content_type; + } + FILE* f = fopen(path, "r"); if (f == NULL) { return NULL;