From: Alan T. DeKok Date: Fri, 5 Aug 2022 13:29:40 +0000 (-0400) Subject: auto-merge edits only if explicitely put into a group X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=379cba332c9b7d72e57bc27ad05fd1e45ff83597;p=thirdparty%2Ffreeradius-server.git auto-merge edits only if explicitely put into a group --- diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index 45ee7a63f8b..d9b0662322d 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -1750,7 +1750,7 @@ static unlang_t *compile_edit_section(unlang_t *parent, unlang_compile_t *unlang static unlang_t *compile_edit_pair(unlang_t *parent, unlang_compile_t *unlang_ctx, unlang_t **prev, CONF_PAIR *cp) { unlang_edit_t *edit, *edit_free; - unlang_t *c, *out = UNLANG_IGNORE; + unlang_t *c = NULL, *out = UNLANG_IGNORE; map_t *map; tmpl_rules_t t_rules; @@ -1763,7 +1763,10 @@ static unlang_t *compile_edit_pair(unlang_t *parent, unlang_compile_t *unlang_ct t_rules.attr.list_as_attr = true; RULES_VERIFY(&t_rules); - c = *prev; + /* + * Auto-merge pairs only if they're all in a group. + */ + if (unlang_ctx->all_edits) c = *prev; edit = edit_free = NULL; if (c && (c->type == UNLANG_TYPE_EDIT)) {