]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
config.c: Fix #include after [section](+). 22/1422/1
authorRichard Mudgett <rmudgett@digium.com>
Mon, 12 Oct 2015 16:21:55 +0000 (11:21 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 12 Oct 2015 18:04:43 +0000 (13:04 -0500)
An #include right after a [section](+) would associate any variable
assignments before a new section in the #include with the wrong section.

* Fix section association by setting the current section to the appended
section.

* Fix '+' and '!' section flag interaction corner case depending upon
which flag came first.  If the '!' came first then it would be ignored.
If the '!' came after then it would affect the appended section.  The '!'
will now no longer be ignored.

ASTERISK-25461 #close
Reported by: Sean Pimental

Change-Id: Ic9d3191c8758048e2cbce6432f854b32531731c3

main/config.c

index 7484b66ba4bc70d08d5724152e281852964410b2..fd03c906f22f7a92ccbcdd60885abe4d25c8e465 100644 (file)
@@ -1696,6 +1696,8 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
                                                return -1;
                                        }
                                        if (newcat) {
+                                               ast_config_set_current_category(cfg, *cat);
+                                               (*cat)->ignored |= newcat->ignored;
                                                move_variables(newcat, *cat);
                                                ast_category_destroy(newcat);
                                                newcat = NULL;