aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-13 15:21:43 +0100
committerDavid Robillard <d@drobilla.net>2020-11-13 15:21:43 +0100
commit18949858d9710196c64d484b8cc621c4dc78adc2 (patch)
treef9c6f8e6296edf002dfc5778b745ea53ae82f244 /src
parentd63f832e64b8b7faf14575584e356533be349280 (diff)
downloadserd-18949858d9710196c64d484b8cc621c4dc78adc2.tar.gz
serd-18949858d9710196c64d484b8cc621c4dc78adc2.tar.bz2
serd-18949858d9710196c64d484b8cc621c4dc78adc2.zip
Fix test coverage
Diffstat (limited to 'src')
-rw-r--r--src/env.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/env.c b/src/env.c
index ac081ee0..843db088 100644
--- a/src/env.c
+++ b/src/env.c
@@ -76,7 +76,7 @@ serd_env_set_base_uri(SerdEnv* env,
{
if (!env || (uri && uri->type != SERD_URI)) {
return SERD_ERR_BAD_ARG;
- } else if (!uri) {
+ } else if (!uri || !uri->buf) {
serd_node_free(&env->base_uri_node);
env->base_uri_node = SERD_NODE_NULL;
env->base_uri = SERD_URI_NULL;
@@ -88,14 +88,12 @@ serd_env_set_base_uri(SerdEnv* env,
SerdNode base_uri_node = serd_node_new_uri_from_node(
uri, &env->base_uri, &base_uri);
- if (base_uri_node.buf) {
- // Replace the current base URI
- serd_node_free(&env->base_uri_node);
- env->base_uri_node = base_uri_node;
- env->base_uri = base_uri;
- return SERD_SUCCESS;
- }
- return SERD_ERR_BAD_ARG;
+ // Replace the current base URI
+ serd_node_free(&env->base_uri_node);
+ env->base_uri_node = base_uri_node;
+ env->base_uri = base_uri;
+
+ return SERD_SUCCESS;
}
static inline SERD_PURE_FUNC SerdPrefix*