From cb580bb689733d8db0921f2a3a2232133b9d26b5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 10 Dec 2014 19:29:36 +0000 Subject: Fix serd_reader_read_file() for URIs with escaped characters (spaces). git-svn-id: http://svn.drobilla.net/serd/trunk@479 490d8e77-9747-427b-9fa3-0b8f29cee8a0 --- NEWS | 3 ++- src/reader.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 75d7f483..54781a7c 100644 --- a/NEWS +++ b/NEWS @@ -1,10 +1,11 @@ serd (0.21.0) unstable; * Remove dependence on fmax() to avoid portability issues + * Fix serd_reader_read_file() for URIs with escaped characters (spaces) * Report errors for invalid IRI characters and missing terminators * Fix warnings when building with ISO C++ compilers - -- David Robillard Tue, 09 Dec 2014 16:24:15 -0500 + -- David Robillard Wed, 10 Dec 2014 14:29:19 -0500 serd (0.20.0) stable; diff --git a/src/reader.c b/src/reader.c index 12d81fac..80f1c2ed 100644 --- a/src/reader.c +++ b/src/reader.c @@ -1553,18 +1553,20 @@ SerdStatus serd_reader_read_file(SerdReader* reader, const uint8_t* uri) { - const uint8_t* path = serd_uri_to_path(uri); + uint8_t* const path = serd_file_uri_parse(uri, NULL); if (!path) { return SERD_ERR_BAD_ARG; } FILE* fd = serd_fopen((const char*)path, "r"); if (!fd) { + free(path); return SERD_ERR_UNKNOWN; } SerdStatus ret = serd_reader_read_file_handle(reader, fd, path); fclose(fd); + free(path); return ret; } -- cgit v1.2.1