diff src/audacious/input.c @ 2430:4e2fc64d95ef trunk

[svn] - make vfs_buffered_file_new_from_uri declaration const - cope properly with subsong URIs
author nenolod
date Sat, 27 Jan 2007 11:40:05 -0800
parents 64948ea58c53
children f346d30bf5ab
line wrap: on
line diff
--- a/src/audacious/input.c	Sat Jan 27 11:28:14 2007 -0800
+++ b/src/audacious/input.c	Sat Jan 27 11:40:05 2007 -0800
@@ -418,11 +418,21 @@
     InputPlugin *ip;
     gchar *filename_proxy;
     gint ret = 1;
-    gchar *ext;
+    gchar *ext, *tmp, *tmp_uri;
     gboolean use_ext_filter;
 
     filename_proxy = g_strdup(filename);
-    fd = vfs_buffered_file_new_from_uri(filename_proxy);
+
+    /* Some URIs will end in ?<subsong> to determine the subsong requested. */
+    tmp_uri = g_strdup(filename);
+
+    tmp = strrchr(tmp_uri, '?');
+
+    if (tmp != NULL)
+        *tmp = '\0';
+
+    fd = vfs_buffered_file_new_from_uri(tmp_uri);
+    g_free(tmp_uri);
 
     ext = strrchr(filename_proxy, '.') + 1;