mirror of
https://github.com/mirror/wget.git
synced 2025-01-16 15:21:14 +08:00
Fix --accept-regex/i--reject-regex for FTP
* src/ftp.c (ftp_retrieve_glob): Call accept_url() with the full URL Reported-by: Frans de Boer <frans@fransdb.nl>
This commit is contained in:
parent
2e4504c553
commit
5b7d068a4b
27
src/ftp.c
27
src/ftp.c
@ -2660,11 +2660,30 @@ ftp_retrieve_glob (struct url *u, struct url *original_url,
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!accept_url (f->name))
|
||||
if (opt.acceptregex || opt.rejectregex)
|
||||
{
|
||||
logprintf (LOG_VERBOSE, _("%s is excluded/not-included through regex.\n"), f->name);
|
||||
f = delelement (&f, &start);
|
||||
continue;
|
||||
// accept_url() takes the full URL.
|
||||
char buf[1024];
|
||||
char *url = buf;
|
||||
|
||||
if ((unsigned) snprintf(buf, sizeof(buf), "%s%s%s",
|
||||
u->url, f->name, f->type == FT_DIRECTORY ? "/" : "")
|
||||
>= sizeof(buf))
|
||||
{
|
||||
url = aprintf("%s%s%s", u->url, f->name, f->type == FT_DIRECTORY ? "/" : "");
|
||||
}
|
||||
|
||||
if (!accept_url (url))
|
||||
{
|
||||
logprintf (LOG_VERBOSE, _ ("%s is excluded/not-included through regex.\n"), url);
|
||||
f = delelement (&f, &start);
|
||||
if (url != buf)
|
||||
xfree(url);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (url != buf)
|
||||
xfree(url);
|
||||
}
|
||||
|
||||
/* Now weed out the files that do not match our globbing pattern.
|
||||
|
Loading…
Reference in New Issue
Block a user