aboutsummaryrefslogtreecommitdiffstats
path: root/src/uri.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/uri.c11
1 files changed, 9 insertions, 2 deletions
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;
+
+ ++suffix;
+
+ if (strchr(suffix, '/') != NULL)
+ return NULL;
- return dot != NULL ? dot + 1 : NULL;
+ return suffix;
}
char *