summaryrefslogtreecommitdiff
path: root/src/tool_operate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tool_operate.c')
-rw-r--r--src/tool_operate.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 3087d2d14..4ecb1ed5f 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -829,12 +829,6 @@ static CURLcode single_transfer(struct GlobalConfig *global,
separator = ((!state->outfiles ||
!strcmp(state->outfiles, "-")) && urlnum > 1);
- /* Here's looping around each globbed URL */
-
- if(state->li >= urlnum) {
- state->li = 0;
- state->up++;
- }
if(state->up < state->infilenum) {
struct per_transfer *per;
struct OutStruct *outs;
@@ -1908,6 +1902,15 @@ static CURLcode single_transfer(struct GlobalConfig *global,
per->retrystart = tvnow();
state->li++;
+ /* Here's looping around each globbed URL */
+ if(state->li >= urlnum) {
+ state->li = 0;
+ state->urlnum = 0; /* forced reglob of URLs */
+ glob_cleanup(state->urls);
+ state->urls = NULL;
+ state->up++;
+ Curl_safefree(state->uploadfile); /* clear it to get the next */
+ }
}
else {
/* Free this URL node data without destroying the