aboutsummaryrefslogtreecommitdiffstats
path: root/src/uri.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/uri.c')
-rw-r--r--src/uri.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/uri.c b/src/uri.c
index b254bea6..096a45e4 100644
--- a/src/uri.c
+++ b/src/uri.c
@@ -437,8 +437,10 @@ serd_uri_serialise_relative(const SerdURI* uri,
SerdSink sink,
void* stream)
{
- size_t len = 0;
- const bool relative = uri_is_under(uri, root ? root : base);
+ size_t len = 0;
+ const bool relative =
+ root ? uri_is_under(uri, root) : uri_is_related(uri, base);
+
if (relative) {
len = write_rel_path(sink, stream, uri, base);
}