Skip to content

Commit 63e4344

Browse files
committed
patch 8.0.0094
Problem: When vimrun.exe is not found the error message is not properly encoded. Solution: Use utf-16 and MessageBoxW(). (Ken Takata)
1 parent dda39ae commit 63e4344

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

src/os_win32.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4705,12 +4705,24 @@ mch_call_shell(
47054705
#if defined(FEAT_GUI_W32)
47064706
if (need_vimrun_warning)
47074707
{
4708-
MessageBox(NULL,
4709-
_("VIMRUN.EXE not found in your $PATH.\n"
4710-
"External commands will not pause after completion.\n"
4711-
"See :help win32-vimrun for more information."),
4712-
_("Vim Warning"),
4713-
MB_ICONWARNING);
4708+
char *msg = _("VIMRUN.EXE not found in your $PATH.\n"
4709+
"External commands will not pause after completion.\n"
4710+
"See :help win32-vimrun for more information.");
4711+
char *title = _("Vim Warning");
4712+
# ifdef FEAT_MBYTE
4713+
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
4714+
{
4715+
WCHAR *wmsg = enc_to_utf16((char_u *)msg, NULL);
4716+
WCHAR *wtitle = enc_to_utf16((char_u *)title, NULL);
4717+
4718+
if (wmsg != NULL && wtitle != NULL)
4719+
MessageBoxW(NULL, wmsg, wtitle, MB_ICONWARNING);
4720+
vim_free(wmsg);
4721+
vim_free(wtitle);
4722+
}
4723+
else
4724+
# endif
4725+
MessageBox(NULL, msg, title, MB_ICONWARNING);
47144726
need_vimrun_warning = FALSE;
47154727
}
47164728
if (!s_dont_use_vimrun && p_stmp)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
94,
767769
/**/
768770
93,
769771
/**/

0 commit comments

Comments
 (0)