summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-12-10 19:32:25 +0000
committerDavid Robillard <d@drobilla.net>2014-12-10 19:32:25 +0000
commit57a210d7bcf2cce9d3f5ec4ece7faf6b7a9be79d (patch)
treed4acf78998cb8f6911a54b3c31c0776e8561cd5f /src
parentee7ad94720483fc24deb108441b65acf8e03f66d (diff)
downloadlilv-57a210d7bcf2cce9d3f5ec4ece7faf6b7a9be79d.tar.gz
lilv-57a210d7bcf2cce9d3f5ec4ece7faf6b7a9be79d.tar.bz2
lilv-57a210d7bcf2cce9d3f5ec4ece7faf6b7a9be79d.zip
Fix loading files with spaces in their path.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5493 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/world.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/world.c b/src/world.c
index 10382c7..460ef7a 100644
--- a/src/world.c
+++ b/src/world.c
@@ -677,13 +677,13 @@ load_dir_entry(const char* dir, const char* name, void* data)
if (!strcmp(name, ".") || !strcmp(name, ".."))
return;
- const char* scheme = (dir[0] == '/') ? "file://" : "file:///";
- char* uri = lilv_strjoin(scheme, dir, "/", name, "/", NULL);
- LilvNode* uri_val = lilv_new_uri(world, uri);
+ char* path = lilv_strjoin(dir, "/", name, "/", NULL);
+ SerdNode suri = serd_node_new_file_uri((const uint8_t*)path, 0, 0, true);
+ LilvNode* node = lilv_new_uri(world, (const char*)suri.buf);
- lilv_world_load_bundle(world, uri_val);
- lilv_node_free(uri_val);
- free(uri);
+ lilv_world_load_bundle(world, node);
+ lilv_node_free(node);
+ serd_node_free(&suri);
}
/** Load all bundles in the directory at `dir_path`. */