summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-17 18:46:21 +0100
committerDavid Robillard <d@drobilla.net>2020-11-17 18:46:21 +0100
commit09aee4137b742819eb1ebfe4390d8809393e32ab (patch)
tree665df28295fa8c34a4e125b72035564aeae7de7f
parent7da3dbcfae5531e67a5c317676b739b38d527411 (diff)
downloadsord-09aee4137b742819eb1ebfe4390d8809393e32ab.tar.gz
sord-09aee4137b742819eb1ebfe4390d8809393e32ab.tar.bz2
sord-09aee4137b742819eb1ebfe4390d8809393e32ab.zip
Remove use of deprecated serd_uri_to_path()
-rw-r--r--src/sord_validate.c6
-rw-r--r--src/sordi.c9
2 files changed, 11 insertions, 4 deletions
diff --git a/src/sord_validate.c b/src/sord_validate.c
index d0543e3..3defdec 100644
--- a/src/sord_validate.c
+++ b/src/sord_validate.c
@@ -712,9 +712,11 @@ main(int argc, char** argv)
SerdReader* reader = sord_new_reader(model, env, SERD_TURTLE, NULL);
for (; a < argc; ++a) {
- const uint8_t* input = (const uint8_t*)argv[a];
- uint8_t* in_path = absolute_path(serd_uri_to_path(input));
+ const uint8_t* input = (const uint8_t*)argv[a];
+ uint8_t* rel_in_path = serd_file_uri_parse(input, NULL);
+ uint8_t* in_path = absolute_path(rel_in_path);
+ free(rel_in_path);
if (!in_path) {
fprintf(stderr, "Skipping file %s\n", input);
continue;
diff --git a/src/sordi.c b/src/sordi.c
index 46e6273..49d761b 100644
--- a/src/sordi.c
+++ b/src/sordi.c
@@ -132,11 +132,15 @@ main(int argc, char** argv)
return print_usage(argv[0], true);
}
- const uint8_t* input = (const uint8_t*)argv[a++];
+ uint8_t* input_path = NULL;
+ const uint8_t* input = (const uint8_t*)argv[a++];
if (from_file) {
in_name = in_name ? in_name : input;
if (!in_fd) {
- input = serd_uri_to_path(in_name);
+ if (!strncmp((const char*)input, "file:", 5)) {
+ input_path = serd_file_uri_parse(input, NULL);
+ input = input_path;
+ }
if (!input || !(in_fd = fopen((const char*)input, "rb"))) {
return 1;
}
@@ -192,6 +196,7 @@ main(int argc, char** argv)
serd_env_free(env);
serd_env_free(write_env);
serd_node_free(&base);
+ free(input_path);
sord_free(sord);
sord_world_free(world);