fix(config): fix parse error when list ends on last line of config file (#3772)
Some checks failed
CI / GitHub Env Debug (push) Has been cancelled
CI / Setup Release (push) Has been cancelled
CI Docker / Check Dockerfiles (push) Has been cancelled
CodeQL / Get language matrix (push) Has been cancelled
localize / Update Localization (push) Has been cancelled
Build GH-Pages / prep (push) Has been cancelled
CI / Linux Flatpak (aarch64, ubuntu-22.04-arm) (push) Has been cancelled
CI / Linux Flatpak (x86_64, ubuntu-22.04) (push) Has been cancelled
CI / Linux AppImage (push) Has been cancelled
CI / Homebrew (macos-13) (push) Has been cancelled
CI / Homebrew (macos-14) (push) Has been cancelled
CI / Homebrew (ubuntu-latest) (push) Has been cancelled
CI / Homebrew (ubuntu-latest (Release)) (push) Has been cancelled
CI / Windows (push) Has been cancelled
CI Docker / Setup Release (push) Has been cancelled
CI Docker / Docker${{ matrix.tag }} (push) Has been cancelled
CodeQL / Analyze (${{ matrix.name }}) (push) Has been cancelled
Build GH-Pages / call-jekyll-build (push) Has been cancelled

This commit is contained in:
ReenigneArcher
2025-03-31 16:05:02 -04:00
committed by GitHub
parent 7ca2721739
commit fc9b548edd

View File

@@ -652,9 +652,13 @@ namespace config {
// Lists might contain newlines
if (*begin_val == '[') {
endl = skip_list(begin_val + 1, end);
if (endl == end) {
BOOST_LOG(warning) << "config: Missing ']' in config option: " << to_string(begin, end_name);
// Check if we reached the end of the file without finding a closing bracket
// We know we have a valid closing bracket if:
// 1. We didn't reach the end, or
// 2. We reached the end but the last character was the matching closing bracket
if (endl == end && end == begin_val + 1) {
BOOST_LOG(warning) << "config: Missing ']' in config option: " << to_string(begin, end_name);
return std::make_pair(endl, std::nullopt);
}
}