]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.124 v7.4.124
authorBram Moolenaar <Bram@vim.org>
Wed, 11 Dec 2013 17:21:45 +0000 (18:21 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 11 Dec 2013 17:21:45 +0000 (18:21 +0100)
Problem:    Win32: Getting host name does not use wide function.
Solution:   Use GetComputerNameW() if possible. (Ken Takata)

src/os_win32.c
src/version.c

index 06cc315e5537b0c73b72d50c4cc1459d8554f634..17df345f23a9cdf53e984a3dda6a345c9f8de42a 100644 (file)
@@ -2808,6 +2808,26 @@ mch_get_host_name(
 {
     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))
        vim_strncpy(s, "PC (Win32 Vim)", len - 1);
 }
index 8a44a1c54dad5b5026ba345f1986c9fdd345b730..f4696d78e64f08d42457ae8b4ff7c74fb739e41b 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    124,
 /**/
     123,
 /**/