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>2022-01-13 15:33:54 -0500
commitecaf46fe09a97fbe6e9c26e8799387dbf3b76070 (patch)
tree0401f829df441e7ff3d0279288ff00f712937531 /src
parent3bf99421c04fdcc789745b7c59fc9bee8edce06b (diff)
downloadserd-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')
-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 c444546d..34de3bfb 100644
--- a/src/node.c
+++ b/src/node.c
@@ -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};
diff --git a/src/serdi.c b/src/serdi.c
index 06d83816..c594a30a 100644
--- a/src/serdi.c
+++ b/src/serdi.c
@@ -322,7 +322,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;