diff options
author | David Robillard <d@drobilla.net> | 2014-12-10 19:32:25 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-12-10 19:32:25 +0000 |
commit | 57a210d7bcf2cce9d3f5ec4ece7faf6b7a9be79d (patch) | |
tree | d4acf78998cb8f6911a54b3c31c0776e8561cd5f | |
parent | ee7ad94720483fc24deb108441b65acf8e03f66d (diff) | |
download | lilv-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
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | src/world.c | 12 |
2 files changed, 8 insertions, 7 deletions
@@ -1,12 +1,13 @@ lilv (0.20.1) unstable; + * Fix loading files with spaces in their path * Tolerate passing NULL to lilv_state_restore() * Fix a few minor/unlikely memory errors * Configure based on compiler target OS for cross-compilation * Windows fixes (thanks John Emmas) * Minor documentation improvements - -- David Robillard <d@drobilla.net> Fri, 21 Nov 2014 20:31:50 -0500 + -- David Robillard <d@drobilla.net> Wed, 10 Dec 2014 14:32:08 -0500 lilv (0.20.0) stable; 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`. */ |