diff options
author | David Robillard <d@drobilla.net> | 2018-06-13 17:11:13 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-27 13:13:58 +0100 |
commit | 93e54363f5ae251acee94051f77305f60f0158c8 (patch) | |
tree | 3fc4e6166ba3d4525446a046a237b66fc9b0c134 /src | |
parent | 06b775c1de2173720fe12abec2fbe225c353a12b (diff) | |
download | serd-93e54363f5ae251acee94051f77305f60f0158c8.tar.gz serd-93e54363f5ae251acee94051f77305f60f0158c8.tar.bz2 serd-93e54363f5ae251acee94051f77305f60f0158c8.zip |
Remove escape parameter from serd_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.c | 4 | ||||
-rw-r--r-- | src/serdi.c | 2 |
2 files changed, 3 insertions, 3 deletions
@@ -455,7 +455,7 @@ is_uri_path_char(const char c) } SerdNode* -serd_new_file_uri(const char* path, const char* hostname, bool escape) +serd_new_file_uri(const char* path, const char* hostname) { const size_t path_len = strlen(path); const size_t hostname_len = hostname ? strlen(hostname) : 0; @@ -476,7 +476,7 @@ serd_new_file_uri(const char* path, const char* hostname, bool escape) serd_buffer_sink("/", 1, 1, &buffer); } else if (path[i] == '%') { serd_buffer_sink("%%", 1, 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, 1, &buffer); } else { char escape_str[4] = { '%', 0, 0, 0 }; diff --git a/src/serdi.c b/src/serdi.c index 5e64e709..14eb04c5 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -198,7 +198,7 @@ main(int argc, char** argv) if (a < argc) { // Base URI given on command line base = serd_new_uri(argv[a]); } else if (!from_string && !from_stdin) { // Use input file URI - base = serd_new_file_uri(input, NULL, true); + base = serd_new_file_uri(input, NULL); } FILE* out_fd = stdout; |