From 8ca1cb35a6ebbeb953e3a87f80376a6b6d650f85 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Mon, 22 Jun 2020 20:32:15 -0700 Subject: [PATCH] Correctly set file and lines on newly created sub-directives --- dovecot/dovecot-lib.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dovecot/dovecot-lib.pl b/dovecot/dovecot-lib.pl index c63fa0c11..279d3c8be 100755 --- a/dovecot/dovecot-lib.pl +++ b/dovecot/dovecot-lib.pl @@ -291,6 +291,11 @@ splice(@$lref, $section->{'line'}, $oldlen, @newlines); &renumber($conf, $section->{'eline'}, $section->{'file'}, scalar(@newlines)-$oldlen); $section->{'eline'} = $section->{'line'} + scalar(@newlines) - 1; +my $i = 1; +foreach my $m (@{$section->{'members'}}) { + $m->{'line'} = $m->{'eline'} = $section->{'line'} + $i++; + $m->{'file'} = $section->{'file'}; + } } # renumber(&conf, line, file, offset)