From a735026f7376456eba7fb55e0c70c3353ea9c25a Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Thu, 22 Jan 2026 12:56:08 +0100 Subject: hotfix 5.7.18 (#730) * make sure we properly convert command line args for zenserver as well * make sure we *add* wildcards/excludes in addition to defaults --- src/zenutil/commandlineoptions.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/zenutil/commandlineoptions.cpp') diff --git a/src/zenutil/commandlineoptions.cpp b/src/zenutil/commandlineoptions.cpp index 81699361b..d94564843 100644 --- a/src/zenutil/commandlineoptions.cpp +++ b/src/zenutil/commandlineoptions.cpp @@ -2,7 +2,11 @@ #include +#include #include + +#include + #if ZEN_WITH_TESTS # include #endif // ZEN_WITH_TESTS @@ -160,6 +164,29 @@ RemoveQuotes(const std::string_view& Arg) return Arg; } +CommandLineConverter::CommandLineConverter(int& argc, char**& argv) +{ +#if ZEN_PLATFORM_WINDOWS + LPWSTR RawCommandLine = GetCommandLineW(); + std::string CommandLine = WideToUtf8(RawCommandLine); + Args = ParseCommandLine(CommandLine); +#else + Args.reserve(argc); + for (int I = 0; I < argc; I++) + { + std::string Arg(argv[I]); + if ((!Arg.empty()) && (Arg != " ")) + { + Args.emplace_back(std::move(Arg)); + } + } +#endif + RawArgs = StripCommandlineQuotes(Args); + + argc = static_cast(RawArgs.size()); + argv = RawArgs.data(); +} + #if ZEN_WITH_TESTS void -- cgit v1.2.3