diff options
author | David Robillard <d@drobilla.net> | 2018-06-13 17:11:13 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-03-07 15:32:23 -0500 |
commit | 6e856d3e7a9c3162b9af350d5cec8a3f6bb94ee2 (patch) | |
tree | 35c1780b24c02daa1f1ed54ba9b664b20f2f526b /src | |
parent | a35d0782c0fb5a52d77dede6b0bffee4e7fdefbd (diff) | |
download | serd-6e856d3e7a9c3162b9af350d5cec8a3f6bb94ee2.tar.gz serd-6e856d3e7a9c3162b9af350d5cec8a3f6bb94ee2.tar.bz2 serd-6e856d3e7a9c3162b9af350d5cec8a3f6bb94ee2.zip |
Remove escape parameter from serd_node_new_file_uri
Since characters are escaped because they are not valid characters in a URI,
any use of this function without escaping is problematic at best.
Diffstat (limited to 'src')
-rw-r--r-- | src/node.c | 5 | ||||
-rw-r--r-- | src/serdi.c | 2 |
2 files changed, 3 insertions, 4 deletions
@@ -179,8 +179,7 @@ is_uri_path_char(const uint8_t c) SerdNode serd_node_new_file_uri(const uint8_t* path, const uint8_t* hostname, - SerdURI* out, - bool escape) + SerdURI* out) { const size_t path_len = strlen((const char*)path); const size_t hostname_len = hostname ? strlen((const char*)hostname) : 0; @@ -209,7 +208,7 @@ serd_node_new_file_uri(const uint8_t* path, serd_buffer_sink("/", 1, &buffer); } else if (path[i] == '%') { serd_buffer_sink("%%", 2, &buffer); - } else if (!escape || is_uri_path_char(path[i])) { + } else if (is_uri_path_char(path[i])) { serd_buffer_sink(path + i, 1, &buffer); } else { char escape_str[4] = {'%', 0, 0, 0}; diff --git a/src/serdi.c b/src/serdi.c index a5c3c0da..0619c5fc 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -315,7 +315,7 @@ main(int argc, char** argv) base = serd_node_new_uri_from_string((const uint8_t*)argv[a], NULL, &base_uri); } else if (from_file && in_fd != stdin) { // Use input file URI - base = serd_node_new_file_uri(input, NULL, &base_uri, true); + base = serd_node_new_file_uri(input, NULL, &base_uri); } FILE* const out_fd = stdout; |