From 0262a77c9a80f056285ff851abaa42404b7335d7 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 19 Mar 2025 22:17:31 -0400 Subject: [PATCH 01/15] fix(packaging/flatpak): move more xvfb modules to LizardByte mirrors (#3739) --- .../linux/flatpak/modules/xvfb/xvfb.json | 60 ++++++++++--------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/packaging/linux/flatpak/modules/xvfb/xvfb.json b/packaging/linux/flatpak/modules/xvfb/xvfb.json index 54322ce4..d4b056c4 100644 --- a/packaging/linux/flatpak/modules/xvfb/xvfb.json +++ b/packaging/linux/flatpak/modules/xvfb/xvfb.json @@ -50,14 +50,32 @@ "name": "libXmu", "sources": [ { - "type": "archive", - "url": "https://xorg.freedesktop.org/archive/individual/lib/libXmu-1.2.1.tar.gz", - "sha256": "bf0902583dd1123856c11e0a5085bd3c6e9886fbbd44954464975fd7d52eb599", + "type": "git", + "url": "https://github.com/LizardByte-infrastructure/libxmu.git", + "tag": "libXmu-1.2.1", + "commit": "792f80402ee06ce69bca3a8f2a84295999c3a170", "x-checker-data": { "type": "anitya", "project-id": 1785, "stable-only": true, - "url-template": "https://xorg.freedesktop.org/archive/individual/lib/libXmu-$version.tar.gz" + "tag-template": "libXmu-$version" + } + } + ] + }, + { + "name": "font-util", + "sources": [ + { + "type": "git", + "url": "https://github.com/LizardByte-infrastructure/font-util.git", + "tag": "font-util-1.4.1", + "commit": "b5ca142f81a6f14eddb23be050291d1c25514777", + "x-checker-data": { + "type": "anitya", + "project-id": 15055, + "stable-only": true, + "tag-template": "font-util-$version" } } ] @@ -66,14 +84,15 @@ "name": "libfontenc", "sources": [ { - "type": "archive", - "url": "https://xorg.freedesktop.org/archive/individual/lib/libfontenc-1.1.8.tar.xz", - "sha256": "7b02c3d405236e0d86806b1de9d6868fe60c313628b38350b032914aa4fd14c6", + "type": "git", + "url": "https://github.com/LizardByte-infrastructure/libfontenc.git", + "tag": "libfontenc-1.1.8", + "commit": "92a85fda2acb4e14ec0b2f6d8fe3eaf2b687218c", "x-checker-data": { "type": "anitya", "project-id": 1613, "stable-only": true, - "url-template": "https://xorg.freedesktop.org/archive/individual/lib/libfontenc-$version.tar.xz" + "tag-template": "libfontenc-$version" } } ] @@ -97,34 +116,19 @@ } ] }, - { - "name": "font-util", - "sources": [ - { - "type": "archive", - "url": "https://xorg.freedesktop.org/archive/individual/font/font-util-1.4.1.tar.gz", - "sha256": "f029ae80cdd75d89bee7f7af61c21e07982adfb9f72344a158b99f91f77ef5ed", - "x-checker-data": { - "type": "anitya", - "project-id": 15055, - "stable-only": true, - "url-template": "https://xorg.freedesktop.org/archive/individual/font/font-util-$version.tar.gz" - } - } - ] - }, { "name": "xvfb-libXfont2", "sources": [ { - "type": "archive", - "url": "https://xorg.freedesktop.org/archive/individual/lib/libXfont2-2.0.6.tar.gz", - "sha256": "a944df7b6837c8fa2067f6a5fc25d89b0acc4011cd0bc085106a03557fb502fc", + "type": "git", + "url": "https://github.com/LizardByte-infrastructure/libxfont.git", + "tag": "libXfont2-2.0.6", + "commit": "d54aaf2483df6a1f98fadc09004157e657b7f73e", "x-checker-data": { "type": "anitya", "project-id": 17165, "stable-only": true, - "url-template": "https://xorg.freedesktop.org/archive/individual/lib/libXfont2-$version.tar.gz" + "tag-template": "libXfont2-$version" } } ] From 310f5b8c1c69aa3fde1875c1990a470884c513fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 09:18:40 -0400 Subject: [PATCH 02/15] build(deps): bump @lizardbyte/shared-web from 2025.221.2011 to 2025.321.1458 (#3742) build(deps): bump @lizardbyte/shared-web Bumps [@lizardbyte/shared-web](https://github.com/LizardByte/shared-web) from 2025.221.2011 to 2025.321.1458. - [Commits](https://github.com/LizardByte/shared-web/commits) --- updated-dependencies: - dependency-name: "@lizardbyte/shared-web" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 93dfb595..248be743 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "serve": "serve ./tests/fixtures/http --no-port-switching" }, "dependencies": { - "@lizardbyte/shared-web": "2025.221.2011", + "@lizardbyte/shared-web": "2025.321.1458", "vue": "3.5.13", "vue-i18n": "11.1.2" }, From 7c8113ded8688cb455272f6068864c3a7be3aafc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 12:27:08 -0400 Subject: [PATCH 03/15] build(deps): bump third-party/build-deps from `0f8f2af` to `c44b312` (#3744) Bumps [third-party/build-deps](https://github.com/LizardByte/build-deps) from `0f8f2af` to `c44b312`. - [Commits](https://github.com/LizardByte/build-deps/compare/0f8f2af955f583c986c634d37ce7655fbff7180a...c44b312538edd3a9ed116a03eee021c8d424d750) --- updated-dependencies: - dependency-name: third-party/build-deps dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third-party/build-deps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/build-deps b/third-party/build-deps index 0f8f2af9..c44b3125 160000 --- a/third-party/build-deps +++ b/third-party/build-deps @@ -1 +1 @@ -Subproject commit 0f8f2af955f583c986c634d37ce7655fbff7180a +Subproject commit c44b312538edd3a9ed116a03eee021c8d424d750 From 873939a7b2cc589a37a065031725ece1c0833af7 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 21 Mar 2025 22:19:57 -0400 Subject: [PATCH 04/15] fix(packaging/windows): add Sunshine directories to system PATH (#3727) --- cmake/packaging/windows.cmake | 10 +- docs/getting_started.md | 2 - src_assets/windows/misc/path/update-path.bat | 111 +++++++++++++++++++ 3 files changed, 119 insertions(+), 4 deletions(-) create mode 100644 src_assets/windows/misc/path/update-path.bat diff --git a/cmake/packaging/windows.cmake b/cmake/packaging/windows.cmake index 5318bb95..fb949aea 100644 --- a/cmake/packaging/windows.cmake +++ b/cmake/packaging/windows.cmake @@ -20,6 +20,9 @@ install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/service/" install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/migration/" DESTINATION "scripts" COMPONENT assets) +install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/path/" + DESTINATION "scripts" + COMPONENT assets) # Configurable options for the service install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/autostart/" @@ -64,6 +67,7 @@ SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS IfSilent +2 0 ExecShell 'open' 'https://docs.lizardbyte.dev/projects/sunshine' nsExec::ExecToLog 'icacls \\\"$INSTDIR\\\" /reset' + nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\update-path.bat\\\" add' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\migrate-config.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\install-gamepad.bat\\\"' @@ -78,7 +82,7 @@ set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS} nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\delete-firewall-rule.bat\\\"' nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\uninstall-service.bat\\\"' - nsExec::ExecToLog '\\\"$INSTDIR\\\\sunshine.exe\\\" --restore-nvprefs-undo' + nsExec::ExecToLog '\\\"$INSTDIR\\\\${CMAKE_PROJECT_NAME}.exe\\\" --restore-nvprefs-undo' MessageBox MB_YESNO|MB_ICONQUESTION \ 'Do you want to remove Virtual Gamepad?' \ /SD IDNO IDNO NoGamepad @@ -88,16 +92,18 @@ set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS 'Do you want to remove $INSTDIR (this includes the configuration, cover images, and settings)?' \ /SD IDNO IDNO NoDelete RMDir /r \\\"$INSTDIR\\\"; skipped if no + nsExec::ExecToLog '\\\"$INSTDIR\\\\scripts\\\\update-path.bat\\\" remove' NoDelete: ") # Adding an option for the start menu -set(CPACK_NSIS_MODIFY_PATH "OFF") +set(CPACK_NSIS_MODIFY_PATH OFF) set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") # This will be shown on the installed apps Windows settings set(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_PROJECT_NAME}.exe") set(CPACK_NSIS_CREATE_ICONS_EXTRA "${CPACK_NSIS_CREATE_ICONS_EXTRA} + SetOutPath '\$INSTDIR' CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${CMAKE_PROJECT_NAME}.lnk' \ '\$INSTDIR\\\\${CMAKE_PROJECT_NAME}.exe' '--shortcut' ") diff --git a/docs/getting_started.md b/docs/getting_started.md index 7d915761..554db9db 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -335,8 +335,6 @@ recommended for most users. No support will be provided!} scripts/uninstall-service.bat ``` -To uninstall, delete the extracted directory which contains the `sunshine.exe` file. - ## Initial Setup After installation, some initial setup is required. diff --git a/src_assets/windows/misc/path/update-path.bat b/src_assets/windows/misc/path/update-path.bat new file mode 100644 index 00000000..d235ec0e --- /dev/null +++ b/src_assets/windows/misc/path/update-path.bat @@ -0,0 +1,111 @@ +@echo off +setlocal EnableDelayedExpansion + +rem Check if parameter is provided +if "%~1"=="" ( + echo Usage: %0 [add^|remove] + echo add - Adds Sunshine directories to system PATH + echo remove - Removes Sunshine directories from system PATH + exit /b 1 +) + +rem Get sunshine root directory +for %%I in ("%~dp0\..") do set "ROOT_DIR=%%~fI" +echo Sunshine root directory: !ROOT_DIR! + +rem Define directories to add to path +set "PATHS_TO_MANAGE[0]=!ROOT_DIR!" +set "PATHS_TO_MANAGE[1]=!ROOT_DIR!\tools" + +rem System path registry location +set "KEY_NAME=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" +set "VALUE_NAME=Path" + +rem Get the current path +for /f "tokens=2*" %%A in ('reg query "%KEY_NAME%" /v "%VALUE_NAME%"') do set "CURRENT_PATH=%%B" +echo Current path: !CURRENT_PATH! + +rem Check if adding to path +if /i "%~1"=="add" ( + set "NEW_PATH=!CURRENT_PATH!" + + rem Process each directory to add + for /L %%i in (0,1,1) do ( + set "DIR_TO_ADD=!PATHS_TO_MANAGE[%%i]!" + + rem Check if path already contains this directory + echo "!CURRENT_PATH!" | findstr /i /c:"!DIR_TO_ADD!" > nul + if !ERRORLEVEL!==0 ( + echo !DIR_TO_ADD! already in path + ) else ( + echo Adding to path: !DIR_TO_ADD! + set "NEW_PATH=!NEW_PATH!;!DIR_TO_ADD!" + ) + ) + + rem Only update if path was changed + if "!NEW_PATH!" neq "!CURRENT_PATH!" ( + rem Set the new path in the registry + reg add "%KEY_NAME%" /v "%VALUE_NAME%" /t REG_EXPAND_SZ /d "!NEW_PATH!" /f + if !ERRORLEVEL!==0 ( + echo Successfully added Sunshine directories to PATH + ) else ( + echo Failed to add Sunshine directories to PATH + ) + ) else ( + echo No changes needed to PATH + ) + exit /b !ERRORLEVEL! +) + +rem Check if removing from path +if /i "%~1"=="remove" ( + set "CHANGES_MADE=0" + + rem Process each directory to remove + for /L %%i in (0,1,1) do ( + set "DIR_TO_REMOVE=!PATHS_TO_MANAGE[%%i]!" + + rem Check if path contains this directory + echo "!CURRENT_PATH!" | findstr /i /c:"!DIR_TO_REMOVE!" > nul + if !ERRORLEVEL!==0 ( + echo Removing from path: !DIR_TO_REMOVE! + + rem Build a new path by parsing and filtering the current path + set "NEW_PATH=" + for %%p in ("!CURRENT_PATH:;=" "!") do ( + set "PART=%%~p" + if /i "!PART!" NEQ "!DIR_TO_REMOVE!" ( + if defined NEW_PATH ( + set "NEW_PATH=!NEW_PATH!;!PART!" + ) else ( + set "NEW_PATH=!PART!" + ) + ) + ) + + set "CURRENT_PATH=!NEW_PATH!" + set "CHANGES_MADE=1" + ) else ( + echo !DIR_TO_REMOVE! not found in path + ) + ) + + rem Only update if path was changed + if "!CHANGES_MADE!"=="1" ( + rem Set the new path in the registry + reg add "%KEY_NAME%" /v "%VALUE_NAME%" /t REG_EXPAND_SZ /d "!CURRENT_PATH!" /f + if !ERRORLEVEL!==0 ( + echo Successfully removed Sunshine directories from PATH + ) else ( + echo Failed to remove Sunshine directories from PATH + ) + ) else ( + echo No changes needed to PATH + ) + exit /b !ERRORLEVEL! +) + +echo Unknown parameter: %~1 +echo Usage: %0 [add^|remove] +exit /b 1 From 5da5293471272fa643863a0f3cbdb190a9476a4b Mon Sep 17 00:00:00 2001 From: LizardByte-bot <108553330+LizardByte-bot@users.noreply.github.com> Date: Sat, 22 Mar 2025 09:22:27 -0400 Subject: [PATCH 05/15] chore: update global workflows (#3724) Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> --- .codeql-prebuild-cpp-macOS.sh | 4 ++++ .github/workflows/codeql.yml | 33 ++++++++++++++++++++------------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.codeql-prebuild-cpp-macOS.sh b/.codeql-prebuild-cpp-macOS.sh index 7fbc090a..1a6be508 100644 --- a/.codeql-prebuild-cpp-macOS.sh +++ b/.codeql-prebuild-cpp-macOS.sh @@ -1,6 +1,10 @@ # install dependencies for C++ analysis set -e +# setup homebrew for x86_64 +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +eval "$(/usr/local/bin/brew shellenv)" + # install dependencies dependencies=( "boost" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 60dbef1c..4fd5fa25 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -51,32 +51,39 @@ jobs: "include": [] } + // Track languages we've already added to avoid duplicates + const addedLanguages = new Set() + for (let [key, value] of Object.entries(response.data)) { // remap language if (remap_languages[key.toLowerCase()]) { console.log(`Remapping language: ${key} to ${remap_languages[key.toLowerCase()]}`) key = remap_languages[key.toLowerCase()] } - if (supported_languages.includes(key.toLowerCase())) { - console.log(`Found supported language: ${key}`) + + const normalizedKey = key.toLowerCase() + + if (supported_languages.includes(normalizedKey) && !addedLanguages.has(normalizedKey)) { + // Mark this language as added + addedLanguages.add(normalizedKey) + + console.log(`Found supported language: ${normalizedKey}`) let osList = ['ubuntu-latest']; - if (key.toLowerCase() === 'swift') { + if (normalizedKey === 'swift') { osList = ['macos-latest']; - } else if (key.toLowerCase() === 'cpp') { - // TODO: update macos to latest after the below issue is resolved - // https://github.com/github/codeql-action/issues/2266 - osList = ['macos-13', 'ubuntu-latest', 'windows-latest']; + } else if (normalizedKey === 'cpp') { + osList = ['macos-latest', 'ubuntu-latest', 'windows-latest']; } for (let os of osList) { // set name for matrix - if (osList.length == 1) { - name = key.toLowerCase() - } else { - name = `${key.toLowerCase()}, ${os}` - } + let name = osList.length === 1 ? normalizedKey : `${normalizedKey}, ${os}` // add to matrix - matrix['include'].push({"language": key.toLowerCase(), "os": os, "name": name}) + matrix['include'].push({ + "language": normalizedKey, + "os": os, + "name": name + }) } } } From e6fbd2400174968cfb56a60e950dd87a5b391777 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 23 Mar 2025 10:21:04 -0400 Subject: [PATCH 06/15] chore(gh-pages): add crowdin-ignore class (#3747) --- gh-pages-template/index.html | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/gh-pages-template/index.html b/gh-pages-template/index.html index 5d6ebd32..24a97352 100644 --- a/gh-pages-template/index.html +++ b/gh-pages-template/index.html @@ -538,11 +538,11 @@ ext-js:
- +
From 5f9fe26df39b241c7956a4204f150277dd182784 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 30 Mar 2025 15:33:39 -0400 Subject: [PATCH 13/15] fix(config): parse config after logging initialized (#3769) --- src/config.cpp | 10 +++++----- src/main.cpp | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index 54eb5236..901e1cae 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -653,7 +653,7 @@ namespace config { if (*begin_val == '[') { endl = skip_list(begin_val + 1, end); if (endl == end) { - std::cout << "Warning: Config option ["sv << to_string(begin, end_name) << "] Missing ']'"sv; + BOOST_LOG(warning) << "config: Missing ']' in config option: " << to_string(begin, end_name); return std::make_pair(endl, std::nullopt); } @@ -988,7 +988,7 @@ namespace config { // The list needs to be a multiple of 2 if (list.size() % 2) { - std::cout << "Warning: expected "sv << name << " to have a multiple of two elements --> not "sv << list.size() << std::endl; + BOOST_LOG(warning) << "config: expected "sv << name << " to have a multiple of two elements --> not "sv << list.size(); return; } @@ -1018,7 +1018,7 @@ namespace config { config::sunshine.flags[config::flag::UPNP].flip(); break; default: - std::cout << "Warning: Unrecognized flag: ["sv << *line << ']' << std::endl; + BOOST_LOG(warning) << "config: Unrecognized flag: ["sv << *line << ']' << std::endl; ret = -1; } @@ -1044,7 +1044,7 @@ namespace config { } for (auto &[name, val] : vars) { - std::cout << "["sv << name << "] -- ["sv << val << ']' << std::endl; + BOOST_LOG(info) << "config: '"sv << name << "' = "sv << val; } int_f(vars, "qp", video.qp); @@ -1425,7 +1425,7 @@ namespace config { shell_exec_info.nShow = SW_NORMAL; if (!ShellExecuteExW(&shell_exec_info)) { auto winerr = GetLastError(); - std::cout << "Error: ShellExecuteEx() failed:"sv << winerr << std::endl; + BOOST_LOG(error) << "Failed executing shell command: " << winerr << std::endl; return 1; } diff --git a/src/main.cpp b/src/main.cpp index 04b080c5..555366ba 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -106,10 +106,6 @@ int main(int argc, char *argv[]) { mail::man = std::make_shared(); - if (config::parse(argc, argv)) { - return 0; - } - auto log_deinit_guard = logging::init(config::sunshine.min_log_level, config::sunshine.log_file); if (!log_deinit_guard) { BOOST_LOG(error) << "Logging failed to initialize"sv; @@ -123,6 +119,11 @@ int main(int argc, char *argv[]) { // Log publisher metadata log_publisher_data(); + // parse config file + if (config::parse(argc, argv)) { + return 0; + } + if (!config::sunshine.cmd.name.empty()) { auto fn = cmd_to_func.find(config::sunshine.cmd.name); if (fn == std::end(cmd_to_func)) { From 7ca2721739d99bfcc49f1a30de9cc73166dda964 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 09:21:22 -0400 Subject: [PATCH 14/15] build(deps): bump packaging/linux/flatpak/deps/shared-modules from `a6c788b` to `1f8e591` (#3773) build(deps): bump packaging/linux/flatpak/deps/shared-modules Bumps [packaging/linux/flatpak/deps/shared-modules](https://github.com/flathub/shared-modules) from `a6c788b` to `1f8e591`. - [Commits](https://github.com/flathub/shared-modules/compare/a6c788b38f8fdd6a48af2d854b0fb5dffb090713...1f8e591b263eef8a0dc04929f2da135af59fac3c) --- updated-dependencies: - dependency-name: packaging/linux/flatpak/deps/shared-modules dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packaging/linux/flatpak/deps/shared-modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/linux/flatpak/deps/shared-modules b/packaging/linux/flatpak/deps/shared-modules index a6c788b3..1f8e591b 160000 --- a/packaging/linux/flatpak/deps/shared-modules +++ b/packaging/linux/flatpak/deps/shared-modules @@ -1 +1 @@ -Subproject commit a6c788b38f8fdd6a48af2d854b0fb5dffb090713 +Subproject commit 1f8e591b263eef8a0dc04929f2da135af59fac3c From fc9b548edd74d829e8aedeef4e76e875e7fc1208 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 31 Mar 2025 16:05:02 -0400 Subject: [PATCH 15/15] fix(config): fix parse error when list ends on last line of config file (#3772) --- src/config.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index 901e1cae..2fbac75d 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -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); } }