diff options
-rw-r--r-- | src/web-view.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/src/web-view.c b/src/web-view.c index f7e410f..31540b3 100644 --- a/src/web-view.c +++ b/src/web-view.c @@ -914,31 +914,27 @@ get_clean_title(MqWebView *web_view) static gboolean extension_is_html(const gchar *extension) { - if (extension[0] == 'h' && extension[1] == 't' && extension[2] == 'm') { - if (extension[3] == '\0') { - return TRUE; - } else if (extension[3] == 'l' && extension[4] == '\0') { - return TRUE; - } - } - return FALSE; + return + extension[0] == 'h' && + extension[1] == 't' && + extension[2] == 'm' && + (extension[3] == '\0' || + (extension[3] == 'l' && + extension[4] == '\0')); } static gboolean extension_is_mhtml(const gchar *extension) { - if (extension[0] == 'm' && extension[1] == 'h' && extension[2] == 't') { - if (extension[3] == '\0') { - return TRUE; - } else if (extension[3] == 'm') { - if (extension[3] == '\0') { - return TRUE; - } else if (extension[4] == 'l' && extension[5] == '\0'){ - return TRUE; - } - } - } - return FALSE; + return + extension[0] == 'm' && + extension[1] == 'h' && + extension[2] == 't' && + (extension[3] == '\0' || + (extension[3] == 'm' && + (extension[4] == '\0' || + (extension[4] == 'l' && + extension[5] == '\0')))); } static void |