From 5065a92d55c2065a7e9ca2299ffe15de5aca42b3 Mon Sep 17 00:00:00 2001 From: bicarus <202771338+bicarus-dev@users.noreply.github.com> Date: Sat, 20 Jun 2026 15:46:45 -0700 Subject: [PATCH] launcher: don't warn about hook option conflicts (#771) DLL hook options (-k and -z) allow multiple flags being specified in both spicecfg and via command line; they never conflict as they are additive. Remove the warning about option conflicts. --- src/spice2x/launcher/launcher.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/spice2x/launcher/launcher.cpp b/src/spice2x/launcher/launcher.cpp index 3e0cc29..69ce4a5 100644 --- a/src/spice2x/launcher/launcher.cpp +++ b/src/spice2x/launcher/launcher.cpp @@ -1549,8 +1549,19 @@ int main_implementation(int argc, char *argv[]) { // print out conflicts size_t conflicts = 0; - for (const auto &option : options) { - if (option.conflicting && option.get_definition().type != OptionType::Bool) { + for (size_t i = 0; i < options.size(); i++) { + // InjectHook / EarlyInjectHook accept multiple values, so command line and + // spicecfg entries are merged rather than conflicting; don't warn about them + if (i == (size_t) launcher::Options::InjectHook || + i == (size_t) launcher::Options::EarlyInjectHook) { + continue; + } + const auto &option = options[i]; + // ignore Boolean values + if (option.get_definition().type == OptionType::Bool) { + continue; + } + if (option.conflicting) { conflicts += 1; const auto& value = option.get_definition().sensitive ? "*****" : option.value; if (launcher::USE_CMD_OVERRIDE) {