From cf046118409cb53363d1a84ddf3ede8a7fd7003c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 9 Dec 2011 21:31:15 +0000 Subject: Fix URI <=> filename conversion. git-svn-id: http://svn.drobilla.net/sord/trunk@179 3d64ff67-21c5-427c-a301-fe4f08042e5a --- sord/sordmm.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sord/sordmm.hpp') 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) { -- cgit v1.2.1