aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/env.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/env.c b/src/env.c
index 11655134..27e29a66 100644
--- a/src/env.c
+++ b/src/env.c
@@ -121,6 +121,7 @@ serd_env_set_base_uri(SerdEnv* env,
serd_node_free(env->base_uri_node);
env->base_uri_node = NULL;
env->base_uri = SERD_URI_NULL;
+ return SERD_SUCCESS;
}
// Resolve base URI and create a new node and URI for it
@@ -181,11 +182,13 @@ serd_env_set_prefix(SerdEnv* env,
const SerdNode* name,
const SerdNode* uri)
{
- if (!name || uri->type != SERD_URI) {
+ if (!name || name->type != SERD_LITERAL || uri->type != SERD_URI) {
return SERD_ERR_BAD_ARG;
} else if (serd_uri_string_has_scheme(serd_node_string(uri))) {
// Set prefix to absolute URI
serd_env_add(env, name, uri);
+ } else if (!env->base_uri_node) {
+ return SERD_ERR_BAD_ARG;
} else {
// Resolve relative URI and create a new node and URI for it
SerdNode* abs_uri = serd_new_resolved_uri_i(