| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: load_http.c,v 1.5 2012/01/30 16:12:04 darrenr Exp $ */ | | 1 | /* $NetBSD: load_http.c,v 1.6 2012/02/03 04:28:55 joerg Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (C) 2010 by Darren Reed. | | 4 | * Copyright (C) 2010 by Darren Reed. |
5 | * | | 5 | * |
6 | * See the IPFILTER.LICENCE file for details on licencing. | | 6 | * See the IPFILTER.LICENCE file for details on licencing. |
7 | * | | 7 | * |
8 | * Id: load_http.c,v 1.5.2.3 2012/01/26 05:29:16 darrenr Exp | | 8 | * Id: load_http.c,v 1.5.2.3 2012/01/26 05:29:16 darrenr Exp |
9 | */ | | 9 | */ |
10 | | | 10 | |
11 | #include "ipf.h" | | 11 | #include "ipf.h" |
12 | #include <ctype.h> | | 12 | #include <ctype.h> |
13 | | | 13 | |
14 | /* | | 14 | /* |
| @@ -164,27 +164,27 @@ load_http(char *url) | | | @@ -164,27 +164,27 @@ load_http(char *url) |
164 | while (isdigit((unsigned char)*u)) | | 164 | while (isdigit((unsigned char)*u)) |
165 | u++; | | 165 | u++; |
166 | if (!isspace((unsigned char)*u) && *u) | | 166 | if (!isspace((unsigned char)*u) && *u) |
167 | u = slash; | | 167 | u = slash; |
168 | } | | 168 | } |
169 | | | 169 | |
170 | /* | | 170 | /* |
171 | * Remove comment and continue to the next line if | | 171 | * Remove comment and continue to the next line if |
172 | * the comment is at the start of the line. | | 172 | * the comment is at the start of the line. |
173 | */ | | 173 | */ |
174 | u = strchr(buffer, '#'); | | 174 | u = strchr(buffer, '#'); |
175 | if (u != NULL) { | | 175 | if (u != NULL) { |
176 | *u = '\0'; | | 176 | *u = '\0'; |
177 | if (u == buffer); | | 177 | if (u == buffer) |
178 | continue; | | 178 | continue; |
179 | } | | 179 | } |
180 | | | 180 | |
181 | /* | | 181 | /* |
182 | * Trim off tailing white spaces, will include \r | | 182 | * Trim off tailing white spaces, will include \r |
183 | */ | | 183 | */ |
184 | for (u = t - 1; (u >= buffer) && ISSPACE(*u); u--) | | 184 | for (u = t - 1; (u >= buffer) && ISSPACE(*u); u--) |
185 | *u = '\0'; | | 185 | *u = '\0'; |
186 | | | 186 | |
187 | a = alist_new(AF_UNSPEC, buffer); | | 187 | a = alist_new(AF_UNSPEC, buffer); |
188 | if (a != NULL) { | | 188 | if (a != NULL) { |
189 | if (rbot != NULL) | | 189 | if (rbot != NULL) |
190 | rbot->al_next = a; | | 190 | rbot->al_next = a; |