Skip to content

Commit 78d8167

Browse files
committed
Fixed issue #34 - file / directory detection
1 parent 4177097 commit 78d8167

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/link.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,12 @@ void Link_set_stat(Link* this_link, CURL *curl)
167167
double cl = 0;
168168
curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &cl);
169169
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;
170+
if (this_link->type == 'F') {
171+
if (cl == -1) {
172+
this_link->type = LINK_INVALID;
173+
} else {
174+
this_link->content_length = cl;
175+
}
176176
}
177177
} else {
178178
fprintf(stderr, "Link_set_stat(): HTTP %ld", http_resp);

0 commit comments

Comments
 (0)