mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.2821: MS-Windows: unnessarily loading libraries when registering OLE
Problem: MS-Windows: unnessarily loading libraries when registering OLE. Solution: Skip loading libraries when invoked with "-register".
This commit is contained in:
@@ -1311,6 +1311,7 @@ EXTERN int wild_menu_showing INIT(= 0);
|
|||||||
#ifdef MSWIN
|
#ifdef MSWIN
|
||||||
EXTERN char_u toupper_tab[256]; // table for toupper()
|
EXTERN char_u toupper_tab[256]; // table for toupper()
|
||||||
EXTERN char_u tolower_tab[256]; // table for tolower()
|
EXTERN char_u tolower_tab[256]; // table for tolower()
|
||||||
|
EXTERN int found_register_arg INIT(= FALSE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_LINEBREAK
|
#ifdef FEAT_LINEBREAK
|
||||||
|
14
src/main.c
14
src/main.c
@@ -161,6 +161,20 @@ main
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef MSWIN
|
||||||
|
// Need to find "-register" before loading any libraries.
|
||||||
|
for (i = 1; i < argc; ++i)
|
||||||
|
if (STRICMP(argv[i] + 1, "register") == 0
|
||||||
|
&& (argv[i][0] == '-' || argv[i][0] == '/'))
|
||||||
|
{
|
||||||
|
found_register_arg = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Various initialisations shared with tests.
|
||||||
|
*/
|
||||||
common_init(¶ms);
|
common_init(¶ms);
|
||||||
|
|
||||||
#ifdef VIMDLL
|
#ifdef VIMDLL
|
||||||
|
@@ -529,6 +529,10 @@ vimLoadLib(char *name)
|
|||||||
{
|
{
|
||||||
HINSTANCE dll = NULL;
|
HINSTANCE dll = NULL;
|
||||||
|
|
||||||
|
// No need to load any library when registering OLE.
|
||||||
|
if (found_register_arg)
|
||||||
|
return dll;
|
||||||
|
|
||||||
// NOTE: Do not use mch_dirname() and mch_chdir() here, they may call
|
// NOTE: Do not use mch_dirname() and mch_chdir() here, they may call
|
||||||
// vimLoadLib() recursively, which causes a stack overflow.
|
// vimLoadLib() recursively, which causes a stack overflow.
|
||||||
if (exe_path == NULL)
|
if (exe_path == NULL)
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2821,
|
||||||
/**/
|
/**/
|
||||||
2820,
|
2820,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user