# HG changeset patch # User yaz # Date 1171524201 28800 # Node ID 7f865e3cd285fdcaf4af62fa5ba3882e04f242f2 # Parent b9167008fc3fd2f351a71bdfb3684b22fea25233 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27. diff -r b9167008fc3f -r 7f865e3cd285 ChangeLog --- a/ChangeLog Wed Feb 14 18:03:22 2007 -0800 +++ b/ChangeLog Wed Feb 14 23:23:21 2007 -0800 @@ -1,3 +1,12 @@ +2007-02-15 02:03:22 +0000 Yoshiki Yazawa + revision [1388] + - strings in audmad_config should be freed before update. thus constant initializer has been replaced with g_strdup(). + + trunk/src/madplug/configure.c | 3 +++ + trunk/src/madplug/plugin.c | 13 +++++++++---- + 2 files changed, 12 insertions(+), 4 deletions(-) + + 2007-02-14 18:15:53 +0000 William Pitcock revision [1386] - make sure audmad_config.id3_format is not NULL. closes #795. diff -r b9167008fc3f -r 7f865e3cd285 src/xspf/xspf.c --- a/src/xspf/xspf.c Wed Feb 14 18:03:22 2007 -0800 +++ b/src/xspf/xspf.c Wed Feb 14 23:23:21 2007 -0800 @@ -51,6 +51,31 @@ gchar *base = NULL; gboolean override_mtime = FALSE; +// this function is taken from libxml2-2.6.27. +static xmlChar * +audPathToURI(const xmlChar *path) +{ + xmlURIPtr uri; + xmlURI temp; + xmlChar *ret, *cal; + + if (path == NULL) + return(NULL); + + if ((uri = xmlParseURI((const char *) path)) != NULL) { + xmlFreeURI(uri); + return xmlStrdup(path); + } + cal = xmlCanonicPath(path); + if (cal == NULL) + return(NULL); + memset(&temp, 0, sizeof(temp)); + temp.path = (char *) cal; + ret = xmlSaveUri(&temp); + xmlFree(cal); + return(ret); +} + static void add_file(xmlNode *track, const gchar *filename, gint pos) { @@ -289,7 +314,7 @@ } else /* local file */ { - gchar *tmp = (gchar *)xmlPathToURI((const xmlChar *)entry->filename); + gchar *tmp = (gchar *)audPathToURI((const xmlChar *)entry->filename); filename = g_strdup_printf("file://%s", tmp); g_free(tmp); }