summaryrefslogtreecommitdiffstats
path: root/src/sordi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sordi.c')
-rw-r--r--src/sordi.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/sordi.c b/src/sordi.c
index 8e15e90..6e3092d 100644
--- a/src/sordi.c
+++ b/src/sordi.c
@@ -5,10 +5,7 @@
#include <serd/serd.h>
#include <sord/sord.h>
-
-#ifdef _WIN32
-# include <windows.h>
-#endif
+#include <zix/filesystem.h>
#include <stdbool.h>
#include <stdint.h>
@@ -140,10 +137,13 @@ main(int argc, char** argv)
SerdURI base_uri = SERD_URI_NULL;
SerdNode base = SERD_NODE_NULL;
if (a < argc) { // Base URI given on command line
- base =
- serd_node_new_uri_from_string((const uint8_t*)argv[a], NULL, &base_uri);
+ const uint8_t* const base_uri_string = (const uint8_t*)argv[a];
+ base = serd_node_new_uri_from_string(base_uri_string, NULL, &base_uri);
} else if (from_file && in_fd != stdin) { // Use input file URI
- base = serd_node_new_file_uri(input, NULL, &base_uri, true);
+ char* const abs_path = zix_canonical_path(NULL, (const char*)input);
+ base =
+ serd_node_new_file_uri((const uint8_t*)abs_path, NULL, &base_uri, true);
+ zix_free(NULL, abs_path);
}
SordWorld* world = sord_world_new();