From 9cfa7120b186b125406a850d373d86e5be40a7bd Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 11 Feb 2022 20:30:38 -0800 Subject: [PATCH] Updater: Fix updating mGBA from a path with spaces on Windows --- src/feature/updater-main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/feature/updater-main.c b/src/feature/updater-main.c index 154702637..4c7277203 100644 --- a/src/feature/updater-main.c +++ b/src/feature/updater-main.c @@ -213,10 +213,14 @@ int main(int argc, char* argv[]) { } mCoreConfigDeinit(&config); if (ok == 0) { - const char* argv[] = { bin, NULL }; #ifdef _WIN32 + char qbin[PATH_MAX + 2] = {0}; + // Windows is a bad operating system + snprintf(qbin, sizeof(qbin), "\"%s\"", bin); + const char* argv[] = { qbin, NULL }; _execv(bin, argv); #elif defined(_POSIX_C_SOURCE) || defined(__APPLE__) + const char* argv[] = { bin, NULL }; execv(bin, argv); #endif }