1
0
forked from aniani/vim

patch 8.1.1060: MS-Windows: get_cmd_args() is no longer needed

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)
This commit is contained in:
Bram Moolenaar
2019-03-27 21:59:45 +01:00
parent 90d0cf69aa
commit 760285dd4f
3 changed files with 8 additions and 165 deletions

View File

@@ -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;