# HG changeset patch # User Jason Rumney # Date 993076589 0 # Node ID b2e0c0638bf2d36cbe1871689821c6b6276e23aa # Parent a7bf2382c0d79420321d82874e7ca07ee0732a10 (WinMain): Add quotes around executable name. diff -r a7bf2382c0d7 -r b2e0c0638bf2 nt/runemacs.c --- a/nt/runemacs.c Wed Jun 20 11:03:58 2001 +0000 +++ b/nt/runemacs.c Wed Jun 20 22:36:29 2001 +0000 @@ -44,8 +44,10 @@ goto error; *p = 0; - new_cmdline = alloca (MAX_PATH + strlen (cmdline) + 1); - strcpy (new_cmdline, modname); + new_cmdline = alloca (MAX_PATH + strlen (cmdline) + 3); + /* Quote executable name in case of spaces in the path. */ + *new_cmdline = '"'; + strcpy (new_cmdline + 1, modname); #ifdef CHOOSE_NEWEST_EXE { @@ -57,7 +59,7 @@ WIN32_FIND_DATA wfd; HANDLE fh; p = new_cmdline + strlen (new_cmdline); - strcpy (p, "\\emacs*.exe "); + strcpy (p, "\\emacs*.exe\" "); fh = FindFirstFile (new_cmdline, &wfd); if (fh == INVALID_HANDLE_VALUE) goto error; @@ -78,7 +80,7 @@ strcat (p, " "); } #else - strcat (new_cmdline, "\\emacs.exe "); + strcat (new_cmdline, "\\emacs.exe\" "); #endif /* Append original arguments if any; first look for arguments we