[Rules] Fix endless loop on unknown {...} in rules on ESP8266

In parse_string_commands() the branch without FEATURE_EXTENDED_STRING_FUNCTIONS
masked '{' and '}' in the whole line instead of in replacement (regression from
4e191fc5b). The following line.replace() put the unmasked braces back, so
get_next_inner_bracket() found them again and the loop never ended
(SW watchdog / exception reset). Mask replacement, as before 4e191fc5b.

Fixes #5653

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aleksandr ZharovandClaude Opus 5.5 committed 2026-10-16 17:01:26 +05:00
1 parent ed56769e43
commit fbd7e43d5d
1 file changed
+2 -2
+2 -2
View File
@@ -884,8 +884,8 @@ void parse_string_commands(String& line) {
#if FEATURE_EXTENDED_STRING_FUNCTIONS #if FEATURE_EXTENDED_STRING_FUNCTIONS
hideMasked(replacement, mustReplaceMaskedChars); // apply hideMasked(replacement, mustReplaceMaskedChars); // apply
#else // if FEATURE_EXTENDED_STRING_FUNCTIONS #else // if FEATURE_EXTENDED_STRING_FUNCTIONS
line.replace('{', static_cast<char>(0x02)); replacement.replace('{', static_cast<char>(0x02));
line.replace('}', static_cast<char>(0x03)); replacement.replace('}', static_cast<char>(0x03));
#endif // if FEATURE_EXTENDED_STRING_FUNCTIONS #endif // if FEATURE_EXTENDED_STRING_FUNCTIONS
} }