transfer: only reset the FTP wildcard engine in CLEAR state

To avoid the state machine to start over and redownload all the files
*again*.

Reported-by: lkordos on github
Regression from 843b3baa3e (shipped in 8.1.0)
Bisect-by: Dan Fandrich
Fixes #11775
Closes #12156
This commit is contained in:
Daniel Stenberg 2023-10-19 13:10:38 +02:00
parent 8cb95850c0
commit df9aea22c2
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -1430,8 +1430,7 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
return CURLE_OUT_OF_MEMORY;
}
wc = data->wildcard;
if((wc->state < CURLWC_INIT) ||
(wc->state >= CURLWC_CLEAN)) {
if(wc->state < CURLWC_INIT) {
if(wc->ftpwc)
wc->dtor(wc->ftpwc);
Curl_safefree(wc->pattern);