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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user