Commit 09aa0dc6 authored by Max Kellermann's avatar Max Kellermann

uri: remove g_basename() call from uri_get_suffix()

g_basename() is deprecated in GLib 2.32. Instead, verify that the suffix does not have a backslash, to catch Windows path names.
parent 83174de4
......@@ -34,13 +34,13 @@ bool uri_has_scheme(const char *uri)
const char *
uri_get_suffix(const char *uri)
{
const char *suffix = strrchr(g_basename(uri), '.');
const char *suffix = strrchr(uri, '.');
if (suffix == NULL)
return NULL;
++suffix;
if (strchr(suffix, '/') != NULL)
if (strpbrk(suffix, "/\\") != NULL)
return NULL;
return suffix;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment