aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-02-04 20:49:28 +0100
committerDavid Robillard <d@drobilla.net>2021-03-07 15:32:23 -0500
commit96bcba9cd94879794de477ae7c5c04971fbd6f32 (patch)
treeced8ec83621bb2ac6f90fc1d9fc0e5b7f38e2c28 /src
parentb9d0b9f058807d7253e88d37822c47b5462b65ea (diff)
downloadserd-96bcba9cd94879794de477ae7c5c04971fbd6f32.tar.gz
serd-96bcba9cd94879794de477ae7c5c04971fbd6f32.tar.bz2
serd-96bcba9cd94879794de477ae7c5c04971fbd6f32.zip
Remove serd_uri_to_path()
Diffstat (limited to 'src')
-rw-r--r--src/uri.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/uri.c b/src/uri.c
index b70992ff..ed927695 100644
--- a/src/uri.c
+++ b/src/uri.c
@@ -25,32 +25,6 @@
#include <stdlib.h>
#include <string.h>
-const uint8_t*
-serd_uri_to_path(const uint8_t* uri)
-{
- const uint8_t* path = uri;
- if (!is_windows_path(uri) && serd_uri_string_has_scheme(uri)) {
- if (strncmp((const char*)uri, "file:", 5)) {
- fprintf(stderr, "Non-file URI `%s'\n", uri);
- return NULL;
- }
-
- if (!strncmp((const char*)uri, "file://localhost/", 17)) {
- path = uri + 16;
- } else if (!strncmp((const char*)uri, "file://", 7)) {
- path = uri + 7;
- } else {
- fprintf(stderr, "Invalid file URI `%s'\n", uri);
- return NULL;
- }
-
- if (is_windows_path(path + 1)) {
- ++path; // Special case for terrible Windows file URIs
- }
- }
- return path;
-}
-
uint8_t*
serd_file_uri_parse(const uint8_t* uri, uint8_t** hostname)
{
@@ -58,6 +32,7 @@ serd_file_uri_parse(const uint8_t* uri, uint8_t** hostname)
if (hostname) {
*hostname = NULL;
}
+
if (!strncmp((const char*)uri, "file://", 7)) {
const uint8_t* auth = uri + 7;
if (*auth == '/') { // No hostname