Changeset 63921 in vbox for trunk/src/VBox/Devices/Network/slirp
- Timestamp:
- Sep 21, 2016 1:06:12 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 110804
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/resolv_conf_parser.c
r63913 r63921 157 157 } 158 158 159 /* 160 * Strip comment if present. 161 * 162 * This is not how ad-hoc parser in bind's res_init.c does it, 163 * btw, so this code will accept more input as valid compared 164 * to res_init. (e.g. "nameserver 1.1.1.1; comment" is 165 * misparsed by res_init). 166 */ 167 for (s = buf; *s != '\0'; ++s) 168 { 169 if (*s == '#' || *s == ';') 170 { 171 *s = '\0'; 172 break; 173 } 174 } 159 175 160 176 tok = getToken(buf, &s); 161 162 /* no more tokens or a comment */ 163 # define NO_VALUE(tok) (tok == NULL || tok[0] == '#' || tok[0] == ';') 164 165 if (NO_VALUE(tok)) 177 if (tok == NULL) 166 178 continue; 167 179 … … 194 206 */ 195 207 tok = getToken(NULL, &s); 196 if ( NO_VALUE(tok))208 if (tok == NULL) 197 209 { 198 210 LogRel(("NAT: resolv.conf: nameserver line without value\n")); … … 252 264 253 265 tok = getToken(NULL, &s); 254 if ( !NO_VALUE(tok))266 if (tok != NULL) 255 267 LogRel(("NAT: resolv.conf: ignoring unexpected trailer on the nameserver line\n")); 256 268 … … 304 316 305 317 tok = getToken(NULL, &s); 306 if ( NO_VALUE(tok))318 if (tok == NULL) 307 319 { 308 320 LogRel(("NAT: resolv.conf: port line without value\n")); … … 336 348 337 349 tok = getToken(NULL, &s); 338 if ( NO_VALUE(tok))350 if (tok == NULL) 339 351 { 340 352 LogRel(("NAT: resolv.conf: domain line without value\n")); … … 362 374 if (RTStrCmp(tok, "search") == 0) 363 375 { 364 while ((tok = getToken(NULL, &s)) && !NO_VALUE(tok))376 while ((tok = getToken(NULL, &s)) && tok != NULL) 365 377 { 366 378 i = state->rcps_num_searchlist;
Note:
See TracChangeset
for help on using the changeset viewer.