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.
This commit is contained in:
Max Kellermann 2012-04-04 12:22:16 +02:00
parent 83174de420
commit 09aa0dc676

View File

@ -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;