From 69656f95db9f2791d15c883d143881d84dd0a1e6 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Thu, 3 Feb 2022 18:30:42 +0100 Subject: [PATCH] Move commandline initialization after cwd setting This fixes an issue where the log file is written to the original directory, even if --working-directory=path was used. This can obviously be pretty bad. --- src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 59764f2..a1c9354 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -77,11 +77,6 @@ int main(int argc, char** argv) { int BeamMPServerMain(MainArguments Arguments) { setlocale(LC_ALL, "C"); - Application::InitializeConsole(); - Application::SetSubsystemStatus("Main", Application::Status::Starting); - - SetupSignalHandlers(); - ArgsParser Parser; Parser.RegisterArgument({ "help" }, ArgsParser::NONE); Parser.RegisterArgument({ "version" }, ArgsParser::NONE); @@ -121,6 +116,11 @@ int BeamMPServerMain(MainArguments Arguments) { } } } + + Application::InitializeConsole(); + Application::SetSubsystemStatus("Main", Application::Status::Starting); + + SetupSignalHandlers(); bool Shutdown = false; Application::RegisterShutdownHandler([&Shutdown] {