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:
parent
83174de420
commit
09aa0dc676
@ -34,13 +34,13 @@ bool uri_has_scheme(const char *uri)
|
|||||||
const char *
|
const char *
|
||||||
uri_get_suffix(const char *uri)
|
uri_get_suffix(const char *uri)
|
||||||
{
|
{
|
||||||
const char *suffix = strrchr(g_basename(uri), '.');
|
const char *suffix = strrchr(uri, '.');
|
||||||
if (suffix == NULL)
|
if (suffix == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
++suffix;
|
++suffix;
|
||||||
|
|
||||||
if (strchr(suffix, '/') != NULL)
|
if (strpbrk(suffix, "/\\") != NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return suffix;
|
return suffix;
|
||||||
|
Loading…
Reference in New Issue
Block a user