Pass the error stream pointer to the URL globber, so that it can report

errors correctly to the user, if need be.

Also fixed so that a missing ] in the globbing process no longer leads
to core dump.
This commit is contained in:
Daniel Stenberg
2003-06-10 09:42:22 +00:00
parent 8d30d34e0c
commit e7fb72a732
3 changed files with 53 additions and 33 deletions

View File

@@ -2592,7 +2592,9 @@ operate(struct Configurable *config, int argc, char *argv[])
if(!config->globoff) {
/* Unless explicitly shut off, we expand '{...}' and '[...]' expressions
and return total number of URLs in pattern set */
res = glob_url(&urls, url, &urlnum);
res = glob_url(&urls, url, &urlnum,
config->showerror?
(config->errors?config->errors:stderr):NULL);
if(res != CURLE_OK)
return res;
}
@@ -2606,7 +2608,7 @@ operate(struct Configurable *config, int argc, char *argv[])
separator = 1;
}
for(i = 0;
(url = urls?next_url(urls):(i?NULL:strdup(url)));
(url = urls?glob_next_url(urls):(i?NULL:strdup(url)));
i++) {
char *outfile;
outfile = outfiles?strdup(outfiles):NULL;
@@ -2636,7 +2638,7 @@ operate(struct Configurable *config, int argc, char *argv[])
else if(urls) {
/* fill '#1' ... '#9' terms from URL pattern */
char *storefile = outfile;
outfile = match_url(storefile, urls);
outfile = glob_match_url(storefile, urls);
free(storefile);
}