# HG changeset patch # User nenolod # Date 1168879479 28800 # Node ID e80c9dfc93aa12c92b79883f7ec2c3c8671ef2ba # Parent 345d38f25eb133d676cac8e181cb15fdb2d4a982 [svn] - g_strsplit() wraps strsplit(3), and thus has different results on different systems (strsplit nul-terminates on uclibc). process URIs in a different way, as a result. diff -r 345d38f25eb1 -r e80c9dfc93aa ChangeLog --- a/ChangeLog Mon Jan 15 08:08:40 2007 -0800 +++ b/ChangeLog Mon Jan 15 08:44:39 2007 -0800 @@ -1,3 +1,11 @@ +2007-01-15 16:08:40 +0000 William Pitcock + revision [3678] + - only evaluate -DHAVE_CONFIG_H if we're in audacious core. closes #760. + + trunk/src/audacious/util.h | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + + 2007-01-15 02:58:03 +0000 William Pitcock revision [3676] - gettext requires mkinstalldirs diff -r 345d38f25eb1 -r e80c9dfc93aa src/audacious/vfs.c --- a/src/audacious/vfs.c Mon Jan 15 08:08:40 2007 -0800 +++ b/src/audacious/vfs.c Mon Jan 15 08:44:39 2007 -0800 @@ -26,6 +26,8 @@ static GList *vfs_transports = NULL; +#define VFS_DEBUG + #ifdef VFS_DEBUG # define DBG(x, args...) g_print(x, ## args); #else @@ -62,7 +64,6 @@ const gchar * mode) { VFSFile *file; - gchar **vec; VFSConstructor *vtable = NULL; GList *node; gchar *decpath; @@ -72,49 +73,26 @@ decpath = xmms_urldecode_plain(path); - vec = g_strsplit(decpath, "://", 2); - - /* special case: no transport specified, look for the "/" transport */ - if (vec[1] == NULL) + for (node = vfs_transports; node != NULL; node = g_list_next(node)) { - for (node = vfs_transports; node != NULL; node = g_list_next(node)) - { - vtable = (VFSConstructor *) node->data; + vtable = (VFSConstructor *) node->data; - if (*vtable->uri_id == '/') - break; - } - } - else - { - for (node = vfs_transports; node != NULL; node = g_list_next(node)) - { - vtable = (VFSConstructor *) node->data; - - if (!g_strcasecmp(vec[0], vtable->uri_id)) - break; - } + if (!strncasecmp(decpath, vtable->uri_id, strlen(vtable->uri_id))) + break; } /* no transport vtable has been registered, bail. */ if (vtable == NULL) - { - g_strfreev(vec); return NULL; - } - file = vtable->vfs_fopen_impl(vec[1] ? vec[1] : vec[0], mode); + file = vtable->vfs_fopen_impl(decpath + strlen(vtable->uri_id), mode); if (file == NULL) - { - g_strfreev(vec); return NULL; - } file->uri = g_strdup(path); file->base = vtable; - g_strfreev(vec); g_free(decpath); return file;