aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/node.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/node.c b/src/node.c
index 1cf24891..7bf915e5 100644
--- a/src/node.c
+++ b/src/node.c
@@ -85,10 +85,13 @@ serd_node_new_uri_from_string(const uint8_t* str,
const SerdURI* base,
SerdURI* out)
{
- // Parse (possibly relative) URI
- SerdURI uri;
- if (serd_uri_parse(str, &uri)) {
- return serd_node_new_uri(&uri, base, out);
+ if (str[0] == '\0') {
+ return serd_node_new_uri(base, NULL, out); // Empty URI => Base URI
+ } else {
+ SerdURI uri;
+ if (serd_uri_parse(str, &uri)) {
+ return serd_node_new_uri(&uri, base, out); // Resolve/Serialise
+ }
}
return SERD_NODE_NULL;
}
@@ -127,5 +130,5 @@ SERD_API
void
serd_node_free(SerdNode* node)
{
- free((uint8_t*)node->buf); // FIXME: ick, const cast
+ free((uint8_t*)node->buf);
}