1 parent 4177097 commit 78d8167Copy full SHA for 78d8167
1 file changed
src/link.c
@@ -167,12 +167,12 @@ void Link_set_stat(Link* this_link, CURL *curl)
167
double cl = 0;
168
curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &cl);
169
curl_easy_getinfo(curl, CURLINFO_FILETIME, &(this_link->time));
170
- if (cl == -1) {
171
- this_link->content_length = 0;
172
- this_link->type = LINK_DIR;
173
- } else {
174
- this_link->content_length = cl;
175
- this_link->type = LINK_FILE;
+ if (this_link->type == 'F') {
+ if (cl == -1) {
+ this_link->type = LINK_INVALID;
+ } else {
+ this_link->content_length = cl;
+ }
176
}
177
} else {
178
fprintf(stderr, "Link_set_stat(): HTTP %ld", http_resp);
0 commit comments