Sophie

Sophie

distrib > Mageia > 2 > x86_64 > by-pkgid > 4bc8b713746a9922544f5f16a8a469bf > files > 9

wget-1.13.4-2.mga2.src.rpm

--- url.c.orig	2011-10-25 17:34:13.561666566 +0200
+++ src/url.c	2011-10-25 17:34:55.015935192 +0200
@@ -492,10 +492,15 @@
 {
   /* Look for '@' that comes before terminators, such as '/', '?',
      '#', or ';'.  */
-  const char *p = (const char *)strpbrk (url, "@/?#;");
-  if (!p || *p != '@')
-    return url;
-  return p + 1;
+  const char *p, *pp;
+  pp = url;
+  while ((p = (const char *)strpbrk (pp, "/?@")) != NULL) {
+    if (*p != '@')
+      break;
+    /* Found '@' character so go on with possible next '@'. */
+    pp = p + 1;
+  }
+  return pp;
 }
 
 /* Parse credentials contained in [BEG, END).  The region is expected