diff options
author | David Robillard <d@drobilla.net> | 2018-02-04 20:49:28 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-13 15:33:54 -0500 |
commit | 16e8c50a29d8a932fa84a74d0b2a732994116db0 (patch) | |
tree | f0e52e13ddf5d7153897aa0dbf68ba5f20283ef3 /src | |
parent | c4bb9e1ca60fd7e82548aa2e5d72e9ab7efda9ca (diff) | |
download | serd-16e8c50a29d8a932fa84a74d0b2a732994116db0.tar.gz serd-16e8c50a29d8a932fa84a74d0b2a732994116db0.tar.bz2 serd-16e8c50a29d8a932fa84a74d0b2a732994116db0.zip |
Remove serd_uri_to_path()
Diffstat (limited to 'src')
-rw-r--r-- | src/uri.c | 27 |
1 files changed, 1 insertions, 26 deletions
@@ -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* const uri, uint8_t** const hostname) { @@ -58,6 +32,7 @@ serd_file_uri_parse(const uint8_t* const uri, uint8_t** const hostname) if (hostname) { *hostname = NULL; } + if (!strncmp((const char*)uri, "file://", 7)) { const uint8_t* auth = uri + 7; if (*auth == '/') { // No hostname |