13
0

Properly encode file URIs in the sfdb.

git-svn-id: svn://localhost/ardour2/trunk@1184 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Taybin Rutkin 2006-12-01 17:37:08 +00:00
parent cba9116196
commit 505d37a58f

View File

@ -19,6 +19,8 @@
#include <sstream>
#include <libxml/uri.h>
#include <lrdf.h>
#include <pbd/compose.h>
@ -59,8 +61,19 @@ AudioLibrary::save_changes ()
string
AudioLibrary::path2uri (string path)
{
xmlURI temp;
memset(&temp, 0, sizeof(temp));
xmlChar *cal = xmlCanonicPath((xmlChar*) path.c_str());
temp.path = (char *) cal;
xmlChar *ret = xmlSaveUri(&temp);
xmlFree(cal);
stringstream uri;
uri << "file:" << path;
uri << "file:" << (const char*) ret;
xmlFree (ret);
return uri.str();
}