From 98fa6fa7f3e0d3b349b78dc3a566a6ea20e343c2 Mon Sep 17 00:00:00 2001 From: theyareonit Date: Sun, 15 Sep 2024 13:54:11 +0200 Subject: [PATCH] shot in the dark --- src/main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index f754d99..407cfcc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,7 @@ #include "includes.hpp" #include +#include #include #include @@ -502,7 +503,13 @@ HANDLE gdMutex; si.cb = sizeof(si); ZeroMemory(&pi, sizeof(pi)); - if (!CreateProcess(CCFileUtils::get()->fullPathForFilename("linux-input.exe"_spr, true).c_str(), NULL, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) { + std::string path = "\"" + CCFileUtils::get()->fullPathForFilename("linux-input.exe"_spr, true) + "\""; + std::replace(path.begin(), path.end(), '\\', '/'); + + std::unique_ptr cmd(new char[path.size() + 1]); + strcpy(cmd.get(), path.c_str()); + + if (!CreateProcess(NULL, cmd.get(), NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) { log::error("Failed to launch Linux input program: {}", GetLastError()); CloseHandle(hMutex); CloseHandle(gdMutex);