3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.124
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.124
3ef2ca
Problem:    Win32: Getting host name does not use wide function.
3ef2ca
Solution:   Use GetComputerNameW() if possible. (Ken Takata)
3ef2ca
Files:	    src/os_win32.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.123/src/os_win32.c	2013-12-11 18:18:01.000000000 +0100
3ef2ca
--- src/os_win32.c	2013-12-11 18:19:11.000000000 +0100
3ef2ca
***************
3ef2ca
*** 2808,2813 ****
3ef2ca
--- 2808,2833 ----
3ef2ca
  {
3ef2ca
      DWORD cch = len;
3ef2ca
  
3ef2ca
+ #ifdef FEAT_MBYTE
3ef2ca
+     if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
3ef2ca
+     {
3ef2ca
+ 	WCHAR wszHostName[256 + 1];
3ef2ca
+ 	DWORD wcch = sizeof(wszHostName) / sizeof(WCHAR);
3ef2ca
+ 
3ef2ca
+ 	if (GetComputerNameW(wszHostName, &wcch))
3ef2ca
+ 	{
3ef2ca
+ 	    char_u  *p = utf16_to_enc(wszHostName, NULL);
3ef2ca
+ 
3ef2ca
+ 	    if (p != NULL)
3ef2ca
+ 	    {
3ef2ca
+ 		vim_strncpy(s, p, len - 1);
3ef2ca
+ 		vim_free(p);
3ef2ca
+ 		return;
3ef2ca
+ 	    }
3ef2ca
+ 	}
3ef2ca
+ 	/* Retry with non-wide function (for Windows 98). */
3ef2ca
+     }
3ef2ca
+ #endif
3ef2ca
      if (!GetComputerName(s, &cch))
3ef2ca
  	vim_strncpy(s, "PC (Win32 Vim)", len - 1);
3ef2ca
  }
3ef2ca
*** ../vim-7.4.123/src/version.c	2013-12-11 18:18:01.000000000 +0100
3ef2ca
--- src/version.c	2013-12-11 18:20:03.000000000 +0100
3ef2ca
***************
3ef2ca
*** 740,741 ****
3ef2ca
--- 740,743 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     124,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
Don't read everything you believe.
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///