From 3cfd39efe99f271536aada7d7cc75121e5e6d96d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 5 Oct 2002 05:42:56 +0000 Subject: [PATCH] Fixed SDL_main.c on Windows CE with applications containing spaces in their names. --- src/main/win32/SDL_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/win32/SDL_main.c b/src/main/win32/SDL_main.c index 65db02f6e..4af3bbc98 100644 --- a/src/main/win32/SDL_main.c +++ b/src/main/win32/SDL_main.c @@ -291,7 +291,9 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) #ifdef _WIN32_WCE nLen = wcslen(szCmdLine)+128+1; bufp = (wchar_t *)alloca(nLen*2); - GetModuleFileName(NULL, bufp, 128); + wcscpy (bufp, "\""); + GetModuleFileName(NULL, bufp+1, 128-3); + wcscpy (bufp+wcslen(bufp), "\" "); wcsncpy(bufp+wcslen(bufp), szCmdLine,nLen-wcslen(bufp)); nLen = wcslen(bufp)+1; cmdline = (char *)alloca(nLen);