Don't fail on executable maps that return no entries. This turns useless
error message into useful one. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
946d0288f2
commit
30ae6e0076
@ -716,7 +716,13 @@ parse_map_yyin(struct node *parent, const char *map, const char *executable_key)
|
||||
for (;;) {
|
||||
ret = yylex();
|
||||
if (ret == 0 || ret == NEWLINE) {
|
||||
if (key != NULL || options != NULL) {
|
||||
/*
|
||||
* In case of executable map, the key is always
|
||||
* non-NULL, even if the map is empty. So, make sure
|
||||
* we don't fail empty maps here.
|
||||
*/
|
||||
if ((key != NULL && executable_key == NULL) ||
|
||||
options != NULL) {
|
||||
log_errx(1, "truncated entry at %s, line %d",
|
||||
map, lineno);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user