From 44177f8c18af89540b90a1cfa38ddda84fc6f747 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 8 Mar 2012 18:53:50 +0000 Subject: Add escape parameter to serd_node_new_file_uri(). git-svn-id: http://svn.drobilla.net/serd/trunk@333 490d8e77-9747-427b-9fa3-0b8f29cee8a0 --- src/node.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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 }; -- cgit v1.2.1