aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-08 18:53:50 +0000
committerDavid Robillard <d@drobilla.net>2012-03-08 18:53:50 +0000
commit44177f8c18af89540b90a1cfa38ddda84fc6f747 (patch)
tree7d4bb7db119982a32ffefe56042b37c65fb2837c /src
parent362fa1151017494b629d4db81487671557bef0a3 (diff)
downloadserd-44177f8c18af89540b90a1cfa38ddda84fc6f747.tar.gz
serd-44177f8c18af89540b90a1cfa38ddda84fc6f747.tar.bz2
serd-44177f8c18af89540b90a1cfa38ddda84fc6f747.zip
Add escape parameter to serd_node_new_file_uri().
git-svn-id: http://svn.drobilla.net/serd/trunk@333 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'src')
-rw-r--r--src/node.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/node.c b/src/node.c
index 1644b6fc..fce2b4cb 100644
--- a/src/node.c
+++ b/src/node.c
@@ -139,7 +139,8 @@ SERD_API
SerdNode
serd_node_new_file_uri(const uint8_t* path,
const uint8_t* hostname,
- SerdURI* out)
+ SerdURI* out,
+ bool escape)
{
const size_t path_len = strlen((const char*)path);
const size_t hostname_len = hostname ? strlen((const char*)hostname) : 0;
@@ -161,7 +162,7 @@ serd_node_new_file_uri(const uint8_t* path,
serd_chunk_sink("/", 1, &chunk);
} else if (path[i] == '%') {
serd_chunk_sink("%%", 2, &chunk);
- } else if (is_uri_path_char(path[i])) {
+ } else if (!escape || is_uri_path_char(path[i])) {
serd_chunk_sink(path + i, 1, &chunk);
} else {
char escape[4] = { '%', 0, 0, 0 };