Re: Bug with user:pass in URL

2002-09-16 Thread Daniel Stenberg

On Tue, 17 Sep 2002, Nikolay Kuzmin wrote:

> There is a bug in wget1.8.2 when username or password contains symbol '@'.
> I think you should change code in file src/url.c from

I disagree. The name and password fields must never contain a @ letter, as it
is a reserved letter in URL strings. If your name or password contain @, then
replace it with %40 in the URL.

-- 
  Daniel Stenberg - http://daniel.haxx.se - +46-705-44 31 77
   ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol




Bug with user:pass in URL

2002-09-16 Thread Nikolay Kuzmin

There is a bug in wget1.8.2 when username or password contains symbol '@'.
I think you should change code in file src/url.c from
"int
url_skip_uname (const char *url)
{
  const char *p;

  /* Look for '@' that comes before '/' or '?'. */
  p = (const char *)strpbrk (url, "/?@");
  if (!p || *p != '@')
return 0;

  return p - url + 1;
}"

to
"int
url_skip_uname (const char *url)
{
  const char *p,*p1;

  /* Look for last '@' that comes before '/' or '?'. */
  p1 = p = (const char *)strpbrk (url, "/?@");
  while(p1 && *p1=='@')
  {
p = p1;
p1 = (const char *)strpbrk (p1 + 1, "/?@");
  }
  if (!p || *p != '@')
return 0;

  return p - url + 1;