diff options
author | David Robillard <d@drobilla.net> | 2020-11-14 12:31:02 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-14 12:39:38 +0100 |
commit | 5c1130819c60f52a3ab1a27711f4d8cca7a4cd14 (patch) | |
tree | 5ffa0df21d30d58e3e442bd9607e32981adbd5a4 /src | |
parent | 2bf875e89f98c64164f563a8d1fae2851d9c023c (diff) | |
download | serd-5c1130819c60f52a3ab1a27711f4d8cca7a4cd14.tar.gz serd-5c1130819c60f52a3ab1a27711f4d8cca7a4cd14.tar.bz2 serd-5c1130819c60f52a3ab1a27711f4d8cca7a4cd14.zip |
Deprecate serd_uri_to_path()
Diffstat (limited to 'src')
-rw-r--r-- | src/serdi.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/serdi.c b/src/serdi.c index c4f0d681..189692dd 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -35,6 +35,7 @@ #include <stdbool.h> #include <stdint.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> #define SERDI_ERROR(msg) fprintf(stderr, "serdi: " msg) @@ -268,11 +269,15 @@ main(int argc, char** argv) _setmode(_fileno(stdout), _O_BINARY); #endif - 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 = serd_fopen((const char*)input, "rb"))) { return 1; } @@ -344,6 +349,7 @@ main(int argc, char** argv) serd_writer_free(writer); serd_env_free(env); serd_node_free(&base); + free(input_path); if (from_file) { fclose(in_fd); |