summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-12-09 21:31:15 +0000
committerDavid Robillard <d@drobilla.net>2011-12-09 21:31:15 +0000
commitcf046118409cb53363d1a84ddf3ede8a7fd7003c (patch)
tree1ff04c1a1986ade5a71287bbf00d599b892c4681
parent13278893d902aa8d917d437b7df473c2a66a163d (diff)
downloadsord-cf046118409cb53363d1a84ddf3ede8a7fd7003c.tar.gz
sord-cf046118409cb53363d1a84ddf3ede8a7fd7003c.tar.bz2
sord-cf046118409cb53363d1a84ddf3ede8a7fd7003c.zip
Fix URI <=> filename conversion.
git-svn-id: http://svn.drobilla.net/sord/trunk@179 3d64ff67-21c5-427c-a301-fe4f08042e5a
-rw-r--r--sord/sordmm.hpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/sord/sordmm.hpp b/sord/sordmm.hpp
index 042a005..8e352d4 100644
--- a/sord/sordmm.hpp
+++ b/sord/sordmm.hpp
@@ -494,7 +494,12 @@ Model::write_to_file(const std::string& uri, SerdSyntax syntax, SerdStyle style)
return SERD_ERR_BAD_ARG;
}
- const uint8_t* path = (const uint8_t*)(uri.c_str() + 5);
+ const uint8_t* path;
+ if (uri.substr(0, 7) == "file://") {
+ path = (const uint8_t*)uri.c_str() + 7;
+ } else {
+ path = (const uint8_t*)uri.c_str() + 5;
+ }
FILE* const fd = fopen((const char*)path, "w");
if (!fd) {