From 6e856d3e7a9c3162b9af350d5cec8a3f6bb94ee2 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 13 Jun 2018 17:11:13 -0400 Subject: 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. --- src/node.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/node.c') 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}; -- cgit v1.2.1