mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07:33 -04:00
updated for version 7.4.124
Problem: Win32: Getting host name does not use wide function. Solution: Use GetComputerNameW() if possible. (Ken Takata)
This commit is contained in:
parent
c8020ee825
commit
2cc8738f2f
@ -2808,6 +2808,26 @@ mch_get_host_name(
|
|||||||
{
|
{
|
||||||
DWORD cch = len;
|
DWORD cch = len;
|
||||||
|
|
||||||
|
#ifdef FEAT_MBYTE
|
||||||
|
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||||
|
{
|
||||||
|
WCHAR wszHostName[256 + 1];
|
||||||
|
DWORD wcch = sizeof(wszHostName) / sizeof(WCHAR);
|
||||||
|
|
||||||
|
if (GetComputerNameW(wszHostName, &wcch))
|
||||||
|
{
|
||||||
|
char_u *p = utf16_to_enc(wszHostName, NULL);
|
||||||
|
|
||||||
|
if (p != NULL)
|
||||||
|
{
|
||||||
|
vim_strncpy(s, p, len - 1);
|
||||||
|
vim_free(p);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Retry with non-wide function (for Windows 98). */
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (!GetComputerName(s, &cch))
|
if (!GetComputerName(s, &cch))
|
||||||
vim_strncpy(s, "PC (Win32 Vim)", len - 1);
|
vim_strncpy(s, "PC (Win32 Vim)", len - 1);
|
||||||
}
|
}
|
||||||
|
@ -738,6 +738,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 */
|
||||||
|
/**/
|
||||||
|
124,
|
||||||
/**/
|
/**/
|
||||||
123,
|
123,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user