diff options
author | David Robillard <d@drobilla.net> | 2018-06-13 17:11:13 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-13 15:33:54 -0500 |
commit | ecaf46fe09a97fbe6e9c26e8799387dbf3b76070 (patch) | |
tree | 0401f829df441e7ff3d0279288ff00f712937531 /src/node.c | |
parent | 3bf99421c04fdcc789745b7c59fc9bee8edce06b (diff) | |
download | serd-ecaf46fe09a97fbe6e9c26e8799387dbf3b76070.tar.gz serd-ecaf46fe09a97fbe6e9c26e8799387dbf3b76070.tar.bz2 serd-ecaf46fe09a97fbe6e9c26e8799387dbf3b76070.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/node.c')
-rw-r--r-- | src/node.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -181,8 +181,7 @@ is_uri_path_char(const uint8_t c) SerdNode serd_node_new_file_uri(const uint8_t* const path, const uint8_t* const hostname, - SerdURI* const out, - const bool escape) + SerdURI* const out) { const size_t path_len = strlen((const char*)path); const size_t hostname_len = hostname ? strlen((const char*)hostname) : 0; @@ -211,7 +210,7 @@ serd_node_new_file_uri(const uint8_t* const path, serd_chunk_sink("/", 1, &chunk); } else if (path[i] == '%') { serd_chunk_sink("%%", 2, &chunk); - } else if (!escape || is_uri_path_char(path[i])) { + } else if (is_uri_path_char(path[i])) { serd_chunk_sink(path + i, 1, &chunk); } else { char escape_str[4] = {'%', 0, 0, 0}; |