aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-02-03 02:59:19 +0000
committerDavid Robillard <d@drobilla.net>2011-02-03 02:59:19 +0000
commit787af7fe07b00057b7d886e9fd508b259914997d (patch)
tree72cf3b70686b0e6d414234bcd5279f91bb245d43 /src
parentcfdea96ce4c01e0aa0bae41e084110d03135f06a (diff)
downloadserd-787af7fe07b00057b7d886e9fd508b259914997d.tar.gz
serd-787af7fe07b00057b7d886e9fd508b259914997d.tar.bz2
serd-787af7fe07b00057b7d886e9fd508b259914997d.zip
Write "//" for URIs with empty authorities (e.g. the correct file:///foo/bar instead of the incorrect file:/foo/bar, even though the authority has length zero).
git-svn-id: http://svn.drobilla.net/serd/trunk@89 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'src')
-rw-r--r--src/uri.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/uri.c b/src/uri.c
index 997489ba..c7f345a4 100644
--- a/src/uri.c
+++ b/src/uri.c
@@ -258,7 +258,10 @@ serd_uri_serialise(const SerdURI* uri, SerdSink sink, void* stream)
}
WRITE_COMPONENT("", uri->scheme, ":");
- WRITE_COMPONENT("//", uri->authority, "");
+ if (uri->authority.buf) {
+ WRITE("//", 2);
+ WRITE(uri->authority.buf, uri->authority.len);
+ }
if (uri->path_base.len) {
if (!uri->path.buf && (uri->fragment.buf || uri->query.buf)) {
WRITE_COMPONENT("", uri->path_base, "");