From 78afb991f090e21dafa3de56796f803a5d262c0a Mon Sep 17 00:00:00 2001 From: "J. Ritchie Carroll" Date: Mon, 8 Jun 2026 15:16:34 -0500 Subject: [PATCH] Fix INI description parsing dropping descriptions containing "word=" Settings.Bind() re-reads settings.ini to recover setting descriptions from the comment lines above each key. The detection regex (INIKeyValuePairPattern) was unanchored, so Regex.Match scanned the entire line and matched any embedded "word=" sequence -- a description such as "...is set to Enabled=false in the database..." was misclassified as a key/value pair, causing the real description for the following setting to be discarded. Anchor the pattern at the start of the line ('^') so only lines that actually begin with an (optionally commented) key=value are treated as settings. This fixes both the GeneratedRegex (NET) and Regex (non-NET) paths since they share the constant. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/Gemstone/Configuration/Settings.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Gemstone/Configuration/Settings.cs b/src/Gemstone/Configuration/Settings.cs index 7368133915..dcd9eaa38d 100644 --- a/src/Gemstone/Configuration/Settings.cs +++ b/src/Gemstone/Configuration/Settings.cs @@ -503,7 +503,11 @@ public static void UpdateInstance(Settings settings) Instance = settings; } - private const string INIKeyValuePairPattern = @";?\s*(?\w+)\s*=.*"; + // Anchored at the start of the line so a description comment that merely *contains* a "word=" + // sequence (e.g. "...is set to Enabled=false in the database...") is not misinterpreted as a + // key/value pair. Without the leading '^', Regex.Match scans the whole line and matches the + // embedded "Enabled=false", which causes the real description above the setting to be dropped. + private const string INIKeyValuePairPattern = @"^;?\s*(?\w+)\s*=.*"; private static readonly Regex s_iniKeyValuePair; static Settings()