aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/uri.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/uri.c b/src/uri.c
index d329c4b5..fbd9e03d 100644
--- a/src/uri.c
+++ b/src/uri.c
@@ -364,8 +364,10 @@ serd_uri_serialise(const SerdURI* uri, SerdSink sink, void* stream)
} while (up > 0 && (--base_last > uri->path_base.buf));
// Write base URI prefix
- const size_t base_len = base_last - uri->path_base.buf + 1;
- WRITE(uri->path_base.buf, base_len);
+ if (*base_last == '/') {
+ const size_t base_len = base_last - uri->path_base.buf + 1;
+ WRITE(uri->path_base.buf, base_len);
+ }
} else {
// Relative path is just query or fragment, append to base URI