Reply To: filenames with question marks are not scanned, patch to fix!

#16189
Anonymous
Inactive

Ok, here’s a patch. I’ve just compiled and it no longer complains about files with question marks! yeay!

— mt-daapd-svn-1696/src/io.c 2007-10-29 06:02:27.000000000 +0000
+++ mt-daapd-svn-1696-io_open_question_mark/src/io.c 2008-02-02 18:29:22.000000000 +0000
@@ -664,15 +664,16 @@
proto_part = uri_copy;
}

– if(path_part)
– io_urldecode(path_part);

/* find the start of the options */
options_part = strchr(path_part,’?’);
if(options_part) {
*options_part = ”;
options_part++;
+ io_urldecode(options_part);
}
+ if(path_part)
+ io_urldecode(path_part);

/* see if we can generate a list of options */
while(options_part) {

My only concern is that some other user of io_open may double encode a url with options in order to work around the original bug

http://some/site?search=string
would be converted into
http://some/site%3fsearch=string
for example, which is bad! Can’t think why that should be the case, but it might be worth thinking about

Either way, this patch appears to solve my problem quite nicely