comparison libaudacious/vfs.c @ 2071:b9c6f1305c99 trunk

[svn] - move urldecode to libaudacious - use urldecode in the VFS layer
author nenolod
date Fri, 08 Dec 2006 15:41:46 -0800
parents 53a3d5db6b58
children f18a5b617c34
comparison
equal deleted inserted replaced
2070:6a2d368a88de 2071:b9c6f1305c99
20 #include <stdio.h> 20 #include <stdio.h>
21 21
22 #include <unistd.h> 22 #include <unistd.h>
23 #include <sys/stat.h> 23 #include <sys/stat.h>
24 #include <sys/types.h> 24 #include <sys/types.h>
25
26 #include "urldecode.h"
25 27
26 static GList *vfs_transports = NULL; 28 static GList *vfs_transports = NULL;
27 29
28 #ifdef VFS_DEBUG 30 #ifdef VFS_DEBUG
29 # define DBG(x, args...) g_print(x, ## args); 31 # define DBG(x, args...) g_print(x, ## args);
62 { 64 {
63 VFSFile *file; 65 VFSFile *file;
64 gchar **vec; 66 gchar **vec;
65 VFSConstructor *vtable = NULL; 67 VFSConstructor *vtable = NULL;
66 GList *node; 68 GList *node;
69 gchar *decpath;
67 70
68 if (!path || !mode) 71 if (!path || !mode)
69 return NULL; 72 return NULL;
70 73
71 vec = g_strsplit(path, "://", 2); 74 decpath = xmms_urldecode_plain(path);
75
76 vec = g_strsplit(decpath, "://", 2);
72 77
73 /* special case: no transport specified, look for the "/" transport */ 78 /* special case: no transport specified, look for the "/" transport */
74 if (vec[1] == NULL) 79 if (vec[1] == NULL)
75 { 80 {
76 for (node = vfs_transports; node != NULL; node = g_list_next(node)) 81 for (node = vfs_transports; node != NULL; node = g_list_next(node))
109 114
110 file->uri = g_strdup(path); 115 file->uri = g_strdup(path);
111 file->base = vtable; 116 file->base = vtable;
112 117
113 g_strfreev(vec); 118 g_strfreev(vec);
119 g_free(decpath);
114 120
115 return file; 121 return file;
116 } 122 }
117 123
118 /** 124 /**