From 342caefec145a8cd4d1fc4dc613adb8b98731105 Mon Sep 17 00:00:00 2001 From: Nick Anderson Date: Tue, 10 Nov 2026 13:37:50 -0600 Subject: [PATCH] Updated plucked.sub.cf from masterfiles Ticket: CFE-3898 Changelog: None Signed-off-by: Nick Anderson --- tests/acceptance/plucked.sub.cf | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/plucked.sub.cf b/tests/acceptance/plucked.sub.cf index 8e18458540b..57990d1a0e2 100644 --- a/tests/acceptance/plucked.sub.cf +++ b/tests/acceptance/plucked.sub.cf @@ -740,10 +740,18 @@ bundle edit_line manage_variable_values_ini(tab, sectionName) { vars: "index" slist => getindices("$(tab)[$(sectionName)]"); + "_escaped_section" string => escape("$(sectionName)"); + + classes: + "section_$(sectionName)_exists" + expression => regline("^\[$(_escaped_section)\]", "$(edit.filename)"), + if => fileexists("$(edit.filename)"), + comment => "Check if the section header already exists in the file"; delete_lines: ".*" select_region => INI_section(escape("$(sectionName)")), + if => canonify("section_$(sectionName)_exists"), comment => "Remove all entries in the region so there are no extra entries"; insert_lines: @@ -752,7 +760,12 @@ bundle edit_line manage_variable_values_ini(tab, sectionName) comment => "Insert lines"; "$(index)=$($(tab)[$(sectionName)][$(index)])" - select_region => INI_section(escape("$(sectionName)")); + select_region => INI_section(escape("$(sectionName)")), + if => canonify("section_$(sectionName)_exists"); + + "$(index)=$($(tab)[$(sectionName)][$(index)])" + location => after("^\[$(_escaped_section)\]"), + if => not(canonify("section_$(sectionName)_exists")); } bundle edit_line set_variable_values_ini(tab, sectionName)