diff --git a/src/uri.c b/src/uri.c index 5c33d3bae..41a613de7 100644 --- a/src/uri.c +++ b/src/uri.c @@ -33,9 +33,16 @@ bool uri_has_scheme(const char *uri) const char * uri_get_suffix(const char *uri) { - const char *dot = strrchr(g_basename(uri), '.'); + const char *suffix = strrchr(g_basename(uri), '.'); + if (suffix == NULL) + return NULL; - return dot != NULL ? dot + 1 : NULL; + ++suffix; + + if (strchr(suffix, '/') != NULL) + return NULL; + + return suffix; } char *