output: do not skip over first range in mustach output

Off by one that is caused by must_next_range() advancing pointer, and moving
over the first range.  Fix by setting indexes one step backwards, that is
not excellent but better than copying skip_ok stuff to must_enter().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2017-11-11 08:20:10 +00:00
parent 50fc4ebe9d
commit d5ae2a80c0
No known key found for this signature in database
GPG key ID: A9553245FDE9B739
2 changed files with 32 additions and 1 deletions

View file

@ -231,9 +231,10 @@ static int must_enter(void *closure, const char *name)
if (!strcmp(name, "subnets")) {
itf.put = must_put_range;
itf.next = must_next_range;
e->current = num_ranges;
e->current = num_ranges + 1;
e->range_p = ranges;
/* must_next_range() will skip_ok when needed */
e->range_p--;
return must_next_range(closure);
}
if (!strcmp(name, "shared-networks")) {