ftplistparser: when wildcarding, skip files with slashes
No binary (build failed)
—
(log yok)
| @@ -323,7 +323,10 @@ static CURLcode ftp_pl_insert_finfo(struct Curl_easy *data, | |
| compare = Curl_fnmatch; | |
| /* filter pattern-corresponding filenames */ | |
| - | { |
| + | if(strchr(finfo->filename, '/')) |
| + | add = FALSE; |
| + | else { |
| + | /* a real file name cannot contain a slash */ |
| struct Curl_mapi_guard guard; | |
| CURL_CBAPI_START(&guard, data, easy_fnmatch_data); | |
| if(compare(data->set.fnmatch_data, wc->pattern, finfo->filename) == 0) { | |
| @@ -187,9 +187,18 @@ my %file_percent_txt = ( | |
| 'perm' => "rw-r--r--" | |
| ); | |
| + | my %file_slash = ( |
| + | 'name' => "really/special", |
| + | 'content' => "slash in the name \n", |
| + | 'time' => "Jan 17 11:01", |
| + | 'dostime' => "01-17-10 11:01AM", |
| + | 'perm' => "rw-rw-rw-" |
| + | ); |
| + | |
| my %lists = ( | |
| '/fully_simulated/percent/' => { | |
| - | 'files' => [ \%file_someothertext_txt, \%file_percent_txt], |
| + | 'files' => [ \%file_someothertext_txt, \%file_percent_txt, |
| + | \%file_slash], |
| 'eol' => "\r\n", | |
| 'type' => "unix" | |
| }, | |