-/* $OpenBSD: clparse.c,v 1.70 2014/01/13 21:36:46 krw Exp $ */
+/* $OpenBSD: clparse.c,v 1.71 2014/01/13 23:42:18 krw Exp $ */
/* Parser for dhclient config and lease files. */
;
if (j == ix)
list[ix++] = i;
- token = next_token(&val, cfile);
+ token = peek_token(NULL, cfile);
+ if (token == ',')
+ token = next_token(NULL, cfile);
} while (token == ',');
- if (token != ';') {
- parse_warn("expecting semicolon.");
- goto syntaxerror;
- }
- return (ix);
+
+ if (parse_semi(cfile))
+ return (ix);
syntaxerror:
skip_to_semi(cfile);
skip_to_semi(cfile);
return;
}
- token = next_token(&val, cfile);
- if (token != ';') {
- parse_warn("expecting semicolon.");
- skip_to_semi(cfile);
- }
+
+ parse_semi(cfile);
}
int
return (-1);
}
}
- token = next_token(&val, cfile);
+ token = peek_token(NULL, cfile);
+ if (*fmt == 'A' && token == ',')
+ token = next_token(NULL, cfile);
} while (*fmt == 'A' && token == ',');
- if (token != ';') {
- parse_warn("semicolon expected.");
- skip_to_semi(cfile);
+ if (!parse_semi(cfile))
return (-1);
- }
options[code].data = malloc(hunkix + nul_term);
if (!options[code].data)
elem->addr = addr;
TAILQ_INSERT_TAIL(&config->reject_list, elem, next);
- token = next_token(NULL, cfile);
+ token = peek_token(NULL, cfile);
+ if (token == ',')
+ token = next_token(NULL, cfile);
} while (token == ',');
- if (token != ';') {
- parse_warn("expecting semicolon.");
- skip_to_semi(cfile);
- }
+ parse_semi(cfile);
}
-/* $OpenBSD: parse.c,v 1.30 2014/01/13 20:56:24 krw Exp $ */
+/* $OpenBSD: parse.c,v 1.31 2014/01/13 23:42:18 krw Exp $ */
/* Common parser code for dhcpd and dhclient. */
ETHER_ADDR_LEN, ':', 16) == 0)
return;
- token = next_token(NULL, cfile);
- if (token != ';') {
- parse_warn("expecting semicolon.");
- skip_to_semi(cfile);
- }
+ parse_semi(cfile);
}
/*