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>2021-03-07 15:32:23 -0500
commit6e856d3e7a9c3162b9af350d5cec8a3f6bb94ee2 (patch)
tree35c1780b24c02daa1f1ed54ba9b664b20f2f526b /src
parenta35d0782c0fb5a52d77dede6b0bffee4e7fdefbd (diff)
downloadserd-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.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 7415ae36..cbb6762b 100644
--- a/src/node.c
+++ b/src/node.c
@@ -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;