aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-12-10 19:29:36 +0000
committerDavid Robillard <d@drobilla.net>2014-12-10 19:29:36 +0000
commitcb580bb689733d8db0921f2a3a2232133b9d26b5 (patch)
tree0c88c4a6d1d0834c2cdbaeff7ec298f660c8b69b /src
parent25e6a687388f217debc3b890a9334e21a0a523ac (diff)
downloadserd-cb580bb689733d8db0921f2a3a2232133b9d26b5.tar.gz
serd-cb580bb689733d8db0921f2a3a2232133b9d26b5.tar.bz2
serd-cb580bb689733d8db0921f2a3a2232133b9d26b5.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/reader.c4
1 files changed, 3 insertions, 1 deletions
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;
}