Skip to content

Fix INI description parsing dropping descriptions containing "word="#28

Merged
ritchiecarroll merged 1 commit into
masterfrom
fix/ini-description-regex-anchor
Jun 8, 2026
Merged

Fix INI description parsing dropping descriptions containing "word="#28
ritchiecarroll merged 1 commit into
masterfrom
fix/ini-description-regex-anchor

Conversation

@ritchiecarroll

Copy link
Copy Markdown
Collaborator

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.

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) <noreply@anthropic.com>
@ritchiecarroll ritchiecarroll merged commit 0acbbeb into master Jun 8, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant