From 96bcba9cd94879794de477ae7c5c04971fbd6f32 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 4 Feb 2018 20:49:28 +0100 Subject: Remove serd_uri_to_path() --- src/uri.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'src') 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 #include -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 -- cgit v1.2.1