summaryrefslogtreecommitdiff
path: root/src/os_w32exe.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-03-27 21:59:45 +0100
committerBram Moolenaar <Bram@vim.org>2019-03-27 21:59:45 +0100
commit760285dd4f20d25e8ae3166996981b8dddba366a (patch)
tree6bc56f14a106b12210b75f02a7a6c96bfcb69438 /src/os_w32exe.c
parent90d0cf69aab7c1d6f5212d47ca1a5fe1a213bbc8 (diff)
downloadvim-git-760285dd4f20d25e8ae3166996981b8dddba366a.tar.gz
patch 8.1.1060: MS-Windows: get_cmd_args() is no longer neededv8.1.1060
Problem: MS-Windows: get_cmd_args() is no longer needed, get_cmd_argsW() is always used. Solution: Remove get_cmd_args(). (Ken Takata, closes #4171)
Diffstat (limited to 'src/os_w32exe.c')
-rw-r--r--src/os_w32exe.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/os_w32exe.c b/src/os_w32exe.c
index 197d65da4..d3ac092b4 100644
--- a/src/os_w32exe.c
+++ b/src/os_w32exe.c
@@ -10,7 +10,7 @@
/*
* Windows GUI: main program (EXE) entry point:
*
- * Ron Aaron <ronaharon@yahoo.com> wrote this and the DLL support code.
+ * Ron Aaron <ronaharon@yahoo.com> wrote this and the DLL support code.
*/
#include "vim.h"
@@ -42,36 +42,25 @@ static void (_cdecl *pSaveInst)(HINSTANCE);
WinMain(
HINSTANCE hInstance UNUSED,
HINSTANCE hPrevInst UNUSED,
- LPSTR lpszCmdLine,
+ LPSTR lpszCmdLine UNUSED,
int nCmdShow UNUSED)
{
int argc = 0;
- char **argv;
- char *tofree;
- char prog[256];
+ char **argv = NULL;
#ifdef VIMDLL
+ char prog[256];
char *p;
HANDLE hLib;
-#endif
/* Ron: added full path name so that the $VIM variable will get set to our
* startup path (so the .vimrc file can be found w/o a VIM env. var.) */
GetModuleFileName(NULL, prog, 255);
- argc = get_cmd_args(prog, (char *)lpszCmdLine, &argv, &tofree);
- if (argc == 0)
- {
- MessageBox(0, "Could not allocate memory for command line.",
- "VIM Error", 0);
- return 0;
- }
-
-#ifdef DYNAMIC_GETTEXT
+# ifdef DYNAMIC_GETTEXT
/* Initialize gettext library */
dyn_libintl_init();
-#endif
+# endif
-#ifdef VIMDLL
// LoadLibrary - get name of dll to load in here:
p = strrchr(prog, '\\');
if (p != NULL)
@@ -127,9 +116,6 @@ WinMain(
FreeLibrary(hLib);
errout:
#endif
- free(argv);
- if (tofree != NULL)
- free(tofree);
free_cmd_argsW();
return 0;