Skip to content

Commit

Permalink
Fixed issue #34 - file / directory detection
Browse files Browse the repository at this point in the history
  • Loading branch information
fangfufu committed Jul 20, 2019
1 parent 4177097 commit 78d8167
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ void Link_set_stat(Link* this_link, CURL *curl)
double cl = 0;
curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &cl);
curl_easy_getinfo(curl, CURLINFO_FILETIME, &(this_link->time));
if (cl == -1) {
this_link->content_length = 0;
this_link->type = LINK_DIR;
} else {
this_link->content_length = cl;
this_link->type = LINK_FILE;
if (this_link->type == 'F') {
if (cl == -1) {
this_link->type = LINK_INVALID;
} else {
this_link->content_length = cl;
}
}
} else {
fprintf(stderr, "Link_set_stat(): HTTP %ld", http_resp);
Expand Down

0 comments on commit 78d8167

Please sign in to comment.