summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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);