Hi,
not sure if there is not a more elegant solution so I post the patch here first:

--- src/main.c.orig     Fri Aug 20 04:00:06 2010
+++ src/main.c  Fri Aug 20 16:06:07 2010
@@ -4312,12 +4312,18 @@
     pc+=3;
   else
     pc=url;
-  pc = strrchr(pc, '/');

-  if(pc) {
+  if((pc = strrchr(pc, '/'))) {
     /* duplicate the string beyond the slash */
     pc++;
-    fn = *pc ? strdup(pc): NULL;
+    if(*pc) {
+      char *par = NULL;
+      fn = strdup(pc);
+      if((par = strchr(fn, '?'))) {
+        /* cut off the question mark and everything beyond */
+        *par = '\0';
+      }
+    }
   }
   return fn;
 }

comments?

Gün.


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to