util/UriExtract: add uri_get_fragment()

This commit is contained in:
Max Kellermann
2019-08-09 16:14:17 +02:00
parent 9c6850210d
commit e4612ecb66
2 changed files with 20 additions and 0 deletions
+10
View File
@@ -138,3 +138,13 @@ uri_get_suffix(const char *uri, UriSuffixBuffer &buffer) noexcept
return suffix;
}
const char *
uri_get_fragment(const char *uri) noexcept
{
const char *fragment = strchr(uri, '#');
if (fragment == nullptr)
return nullptr;
return fragment + 1;
}