summaryrefslogtreecommitdiff
path: root/src/client/http.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/http.c')
-rw-r--r--src/client/http.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/client/http.c b/src/client/http.c
index f63b070..0777ede 100644
--- a/src/client/http.c
+++ b/src/client/http.c
@@ -644,22 +644,25 @@ static void parse_file_list(dlhandle_t *dl)
char *list;
char *p;
+ if (!dl->buffer)
+ return;
+
if (cl_http_filelists->integer) {
list = dl->buffer;
- while (1) {
+ while (*list) {
p = strchr(list, '\n');
if (p) {
if (p > list && *(p - 1) == '\r')
*(p - 1) = 0;
*p = 0;
- if (*list)
- check_and_queue_download(list);
- list = p + 1;
- } else {
- if (*list)
- check_and_queue_download(list);
- break;
}
+
+ if (*list)
+ check_and_queue_download(list);
+
+ if (!p)
+ break;
+ list = p + 1;
}
}