diff options
author | Jason Rumney <jasonr@gnu.org> | 2001-06-20 22:40:29 +0000 |
---|---|---|
committer | Jason Rumney <jasonr@gnu.org> | 2001-06-20 22:40:29 +0000 |
commit | 0ac7bf6c348b2c7776d9caae1d4881c38125698c (patch) | |
tree | be2667e70762e9e1cfb53ffa2cbf82840916d460 /nt | |
parent | 513e7954c847611f69aedbc134e8be542e83d90e (diff) | |
download | emacs-0ac7bf6c348b2c7776d9caae1d4881c38125698c.tar.gz |
(WinMain): Add quotes around executable name.
Diffstat (limited to 'nt')
-rw-r--r-- | nt/ChangeLog | 4 | ||||
-rw-r--r-- | nt/runemacs.c | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/nt/ChangeLog b/nt/ChangeLog index 05ffbd0433c..fb722213d80 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2001-06-20 Jason Rumney <jasonr@gnu.org> + + * runemacs.c (WinMain): Add quotes around command in case of spaces. + 2001-06-01 Andrew Innes <andrewi@gnu.org> * gmake.defs (sh_output): Don't use $(warning ...) to output diff --git a/nt/runemacs.c b/nt/runemacs.c index b918bec7249..2f114aea659 100644 --- a/nt/runemacs.c +++ b/nt/runemacs.c @@ -44,8 +44,10 @@ WinMain (HINSTANCE hSelf, HINSTANCE hPrev, LPSTR cmdline, int nShow) 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 @@ WinMain (HINSTANCE hSelf, HINSTANCE hPrev, LPSTR cmdline, int nShow) 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 @@ WinMain (HINSTANCE hSelf, HINSTANCE hPrev, LPSTR cmdline, int nShow) strcat (p, " "); } #else - strcat (new_cmdline, "\\emacs.exe "); + strcat (new_cmdline, "\\emacs.exe\" "); #endif /* Append original arguments if any; first look for arguments we |