Skip to content

Commit

Permalink
Merge pull request #182 from iain-buclaw-sociomantic/updatelists
Browse files Browse the repository at this point in the history
router_readconfig: adjust a, cl, and r after reading all includes.
  • Loading branch information
grobian committed Jun 4, 2016
2 parents 473f5c9 + 3daa373 commit ce0afbd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions issues/issue180-a.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
match baz
send to blackhole
;
10 changes: 10 additions & 0 deletions issues/issue180.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
match foo
send to blackhole
;

include issue180-a.conf
;

match bar
send to blackhole
;
8 changes: 8 additions & 0 deletions router.c
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,14 @@ router_readconfig(router *orig,
if (ret == NULL)
/* router_readconfig already barked and freed ret */
return NULL;
/* the included file could have added new aggregates, matches, or clusters,
* so adjust these chains to point to the new end. */
for (; a != NULL && a->next != NULL; a = a->next)
;
for (; cl->next != NULL; cl = cl->next)
;
for (; r != NULL && r->next != NULL; r = r->next)
;
*p = endchar;
for (; *p != '\0' && isspace(*p); p++)
;
Expand Down

0 comments on commit ce0afbd

Please sign in to comment.