diff options
author | David Robillard <d@drobilla.net> | 2020-05-22 15:16:24 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-10-27 13:13:59 +0100 |
commit | f9c7cac95abb7c5430c9ecd6f0a7220c3f8b5205 (patch) | |
tree | 92f318b49d9c9d413e62b40be040cdfde0f8cc33 | |
parent | 7026fb72f85e349eea64a62bd924358c608520cc (diff) | |
download | serd-f9c7cac95abb7c5430c9ecd6f0a7220c3f8b5205.tar.gz serd-f9c7cac95abb7c5430c9ecd6f0a7220c3f8b5205.tar.bz2 serd-f9c7cac95abb7c5430c9ecd6f0a7220c3f8b5205.zip |
Allow setting the base URI of an Env to NULL
-rw-r--r-- | src/env.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -115,8 +115,12 @@ SerdStatus serd_env_set_base_uri(SerdEnv* env, const SerdNode* uri) { - if (!env || !uri || uri->type != SERD_URI) { + if (!env || (uri && uri->type != SERD_URI)) { return SERD_ERR_BAD_ARG; + } else if (!uri) { + serd_node_free(env->base_uri_node); + env->base_uri_node = NULL; + env->base_uri = SERD_URI_NULL; } // Resolve base URI and create a new node and URI for it |