aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-11-13 11:33:29 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-11-14 13:44:50 +0100
commit7a46aeb0be3fa00826b0c47a8bc06eddff448659 (patch)
tree09efcedeec3d076049ad1c339abc85b1907d53d6 /src
parent674298d1918ecc7cee45bf6a1f3a88524cb60067 (diff)
curl: fix -T globbing
Regression from e59371a4936f8 (7.67.0) Added test 490, 491 and 492 to verify the functionality. Reported-by: Kamil Dudka Reported-by: Anderson Sasaki Fixes #4588 Closes #4591
Diffstat (limited to 'src')
-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