summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--src/world.c12
2 files changed, 8 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index 1bfec21..10986ad 100644
--- a/NEWS
+++ b/NEWS
@@ -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`. */