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>2019-04-13 19:15:32 +0200
commit1cfecadf30286bb146a9f60154dc9d4e48f8d1cb (patch)
tree1e450bcd0124f46136289e82d7adf866c6fd8fdc /src
parent21ae5645e37837b3933140148ab7c382a834722d (diff)
downloadserd-1cfecadf30286bb146a9f60154dc9d4e48f8d1cb.tar.gz
serd-1cfecadf30286bb146a9f60154dc9d4e48f8d1cb.tar.bz2
serd-1cfecadf30286bb146a9f60154dc9d4e48f8d1cb.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.c4
-rw-r--r--src/serdi.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/node.c b/src/node.c
index 65a87a8b..223598c4 100644
--- a/src/node.c
+++ b/src/node.c
@@ -389,7 +389,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;
@@ -410,7 +410,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 03afee90..e2cdc0c1 100644
--- a/src/serdi.c
+++ b/src/serdi.c
@@ -199,7 +199,7 @@ main(int argc, char** argv)
if (a < argc) { // Base URI given on command line
base = serd_new_uri((const char*)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;