diff options
author | David Robillard <d@drobilla.net> | 2020-08-11 17:31:21 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-27 13:13:59 +0100 |
commit | 9b8f18073e634da1a10cd03967eaef5597c415cc (patch) | |
tree | 7dbb9971867fc48f76aa2d90bf45df46a37ba8c4 /src | |
parent | 44afc616ada1315bfcc1f2fb6bd82656ced8b2f5 (diff) | |
download | serd-9b8f18073e634da1a10cd03967eaef5597c415cc.tar.gz serd-9b8f18073e634da1a10cd03967eaef5597c415cc.tar.bz2 serd-9b8f18073e634da1a10cd03967eaef5597c415cc.zip |
Clean up Env tests and behaviour
Diffstat (limited to 'src')
-rw-r--r-- | src/env.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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( |