mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
updated for version 7.3.707
Problem: Problems loading a library for a file name with non-latin characters. Solution: Use wide system functions when possible. (Ken Takata)
This commit is contained in:
@@ -288,26 +288,39 @@ unescape_shellxquote(char_u *p, char_u *escaped)
|
|||||||
vimLoadLib(char *name)
|
vimLoadLib(char *name)
|
||||||
{
|
{
|
||||||
HINSTANCE dll = NULL;
|
HINSTANCE dll = NULL;
|
||||||
TCHAR old_dir[MAXPATHL];
|
char old_dir[MAXPATHL];
|
||||||
|
|
||||||
/* 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)
|
||||||
get_exe_name();
|
get_exe_name();
|
||||||
if (exe_path != NULL && GetCurrentDirectory(MAXPATHL, old_dir) != 0)
|
if (exe_path != NULL)
|
||||||
{
|
{
|
||||||
/* Change directory to where the executable is, both to make sure we
|
#ifdef FEAT_MBYTE
|
||||||
* find a .dll there and to avoid looking for a .dll in the current
|
WCHAR old_dirw[MAXPATHL];
|
||||||
* directory. */
|
|
||||||
|
if (GetCurrentDirectoryW(MAXPATHL, old_dirw) != 0)
|
||||||
|
{
|
||||||
|
/* Change directory to where the executable is, both to make
|
||||||
|
* sure we find a .dll there and to avoid looking for a .dll
|
||||||
|
* in the current directory. */
|
||||||
|
SetCurrentDirectory(exe_path);
|
||||||
|
dll = LoadLibrary(name);
|
||||||
|
SetCurrentDirectoryW(old_dirw);
|
||||||
|
return dll;
|
||||||
|
}
|
||||||
|
/* Retry with non-wide function (for Windows 98). */
|
||||||
|
if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
|
||||||
|
#endif
|
||||||
|
if (GetCurrentDirectory(MAXPATHL, old_dir) != 0)
|
||||||
|
{
|
||||||
|
/* Change directory to where the executable is, both to make
|
||||||
|
* sure we find a .dll there and to avoid looking for a .dll
|
||||||
|
* in the current directory. */
|
||||||
SetCurrentDirectory(exe_path);
|
SetCurrentDirectory(exe_path);
|
||||||
dll = LoadLibrary(name);
|
dll = LoadLibrary(name);
|
||||||
SetCurrentDirectory(old_dir);
|
SetCurrentDirectory(old_dir);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
/* We are not able to change directory to where the executable is, try
|
|
||||||
* to load library anyway. */
|
|
||||||
dll = LoadLibrary(name);
|
|
||||||
}
|
}
|
||||||
return dll;
|
return dll;
|
||||||
}
|
}
|
||||||
|
@@ -108,7 +108,7 @@
|
|||||||
*/
|
*/
|
||||||
#define CMDBUFFSIZE 1024 /* size of the command processing buffer */
|
#define CMDBUFFSIZE 1024 /* size of the command processing buffer */
|
||||||
|
|
||||||
/* _MAX_PATH is only 256 (stdlib.h), but we want more for the 'path' option,
|
/* _MAX_PATH is only 260 (stdlib.h), but we want more for the 'path' option,
|
||||||
* thus use a larger number. */
|
* thus use a larger number. */
|
||||||
#define MAXPATHL 1024
|
#define MAXPATHL 1024
|
||||||
|
|
||||||
|
@@ -725,6 +725,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 */
|
||||||
|
/**/
|
||||||
|
707,
|
||||||
/**/
|
/**/
|
||||||
706,
|
706,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user