dcaee6
To: vim_dev@googlegroups.com
dcaee6
Subject: Patch 7.4.123
dcaee6
Fcc: outbox
dcaee6
From: Bram Moolenaar <Bram@moolenaar.net>
dcaee6
Mime-Version: 1.0
dcaee6
Content-Type: text/plain; charset=UTF-8
dcaee6
Content-Transfer-Encoding: 8bit
dcaee6
------------
dcaee6
dcaee6
Patch 7.4.123
dcaee6
Problem:    Win32: Getting user name does not use wide function.
dcaee6
Solution:   Use GetUserNameW() if possible. (Ken Takata)
dcaee6
Files:	    src/os_win32.c
dcaee6
dcaee6
dcaee6
*** ../vim-7.4.122/src/os_win32.c	2013-12-11 17:58:29.000000000 +0100
dcaee6
--- src/os_win32.c	2013-12-11 18:14:29.000000000 +0100
dcaee6
***************
dcaee6
*** 2768,2773 ****
dcaee6
--- 2768,2793 ----
dcaee6
      char szUserName[256 + 1];	/* UNLEN is 256 */
dcaee6
      DWORD cch = sizeof szUserName;
dcaee6
  
dcaee6
+ #ifdef FEAT_MBYTE
dcaee6
+     if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
dcaee6
+     {
dcaee6
+ 	WCHAR wszUserName[256 + 1];	/* UNLEN is 256 */
dcaee6
+ 	DWORD wcch = sizeof(wszUserName) / sizeof(WCHAR);
dcaee6
+ 
dcaee6
+ 	if (GetUserNameW(wszUserName, &wcch))
dcaee6
+ 	{
dcaee6
+ 	    char_u  *p = utf16_to_enc(wszUserName, NULL);
dcaee6
+ 
dcaee6
+ 	    if (p != NULL)
dcaee6
+ 	    {
dcaee6
+ 		vim_strncpy(s, p, len - 1);
dcaee6
+ 		vim_free(p);
dcaee6
+ 		return OK;
dcaee6
+ 	    }
dcaee6
+ 	}
dcaee6
+ 	/* Retry with non-wide function (for Windows 98). */
dcaee6
+     }
dcaee6
+ #endif
dcaee6
      if (GetUserName(szUserName, &cch))
dcaee6
      {
dcaee6
  	vim_strncpy(s, szUserName, len - 1);
dcaee6
*** ../vim-7.4.122/src/version.c	2013-12-11 17:58:29.000000000 +0100
dcaee6
--- src/version.c	2013-12-11 18:15:48.000000000 +0100
dcaee6
***************
dcaee6
*** 740,741 ****
dcaee6
--- 740,743 ----
dcaee6
  {   /* Add new patch number below this line */
dcaee6
+ /**/
dcaee6
+     123,
dcaee6
  /**/
dcaee6
dcaee6
-- 
dcaee6
Everybody lies, but it doesn't matter since nobody listens.
dcaee6
                                -- Lieberman's Law
dcaee6
dcaee6
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
dcaee6
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
dcaee6
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
dcaee6
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///