From 2c0cf894f430943c3ea36ca89f2f7ebe8e68a2c6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 2 Oct 2025 10:22:37 +0300 Subject: [PATCH] Fix 'restart-emacs' on MS-Windows * src/w32.c (w32_reexec_emacs): Reset undocumented bits in STARTUPINFO flags. Suggested by yhr0x43 . (Bug#79554) --- src/w32.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/w32.c b/src/w32.c index 7182bee0ab7..d9fee5b6f03 100644 --- a/src/w32.c +++ b/src/w32.c @@ -10939,6 +10939,9 @@ w32_reexec_emacs (char *cmd_line, const char *wdir) DWORD dwCreationFlags = NORMAL_PRIORITY_CLASS; GetStartupInfo (&si); /* Use the same startup info as the caller. */ + /* Reset undocumented bits in STARTUPINFO flags, as they could cause a + crash in the re-exec'ed Emacs. */ + si.dwFlags &= 0xbbff; /* reset the 0x4000 and 0x0400 bits */ if (inhibit_window_system) { HANDLE screen_handle;