aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-06-13 17:11:13 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 16:27:02 -0500
commitb1d30dc791348eacd44ebd6a00d0cf166a9e1cf5 (patch)
tree64a77fc72ea86b30e3610dc6ffa26930bd4e1b85 /src
parentd107eb486f24c0e68eff4e1b622850fca5f75d77 (diff)
downloadserd-b1d30dc791348eacd44ebd6a00d0cf166a9e1cf5.tar.gz
serd-b1d30dc791348eacd44ebd6a00d0cf166a9e1cf5.tar.bz2
serd-b1d30dc791348eacd44ebd6a00d0cf166a9e1cf5.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.c5
-rw-r--r--src/serdi.c2
2 files changed, 3 insertions, 4 deletions
diff --git a/src/node.c b/src/node.c
index 7a7ba0b7..fd2305f7 100644
--- a/src/node.c
+++ b/src/node.c
@@ -178,8 +178,7 @@ is_dir_sep(const char 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;
@@ -206,7 +205,7 @@ serd_node_new_file_uri(const uint8_t* const path,
for (size_t i = 0; i < path_len; ++i) {
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);
#ifdef _WIN32
} else if (path[i] == '\\') {
diff --git a/src/serdi.c b/src/serdi.c
index 2bea9e3a..6ab55b20 100644
--- a/src/serdi.c
+++ b/src/serdi.c
@@ -323,7 +323,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;