File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -2768,6 +2768,26 @@ mch_get_user_name(
27682768 char szUserName [256 + 1 ]; /* UNLEN is 256 */
27692769 DWORD cch = sizeof szUserName ;
27702770
2771+ #ifdef FEAT_MBYTE
2772+ if (enc_codepage >= 0 && (int )GetACP () != enc_codepage )
2773+ {
2774+ WCHAR wszUserName [256 + 1 ]; /* UNLEN is 256 */
2775+ DWORD wcch = sizeof (wszUserName ) / sizeof (WCHAR );
2776+
2777+ if (GetUserNameW (wszUserName , & wcch ))
2778+ {
2779+ char_u * p = utf16_to_enc (wszUserName , NULL );
2780+
2781+ if (p != NULL )
2782+ {
2783+ vim_strncpy (s , p , len - 1 );
2784+ vim_free (p );
2785+ return OK ;
2786+ }
2787+ }
2788+ /* Retry with non-wide function (for Windows 98). */
2789+ }
2790+ #endif
27712791 if (GetUserName (szUserName , & cch ))
27722792 {
27732793 vim_strncpy (s , szUserName , len - 1 );
Original file line number Diff line number Diff line change @@ -738,6 +738,8 @@ static char *(features[]) =
738738
739739static int included_patches [] =
740740{ /* Add new patch number below this line */
741+ /**/
742+ 123 ,
741743/**/
742744 122 ,
743745/**/
You can’t perform that action at this time.
0 commit comments