Skip to content

Commit b8f7bd6

Browse files
committed
patch 8.0.0174: executing "locale -a" on MS-Windows needlessly
Problem: For completion "locale -a" is executed on MS-Windows, even though it most likely won't work. Solution: Skip executing "locale -a" on MS-Windows. (Ken Takata)
1 parent a1fa892 commit b8f7bd6

2 files changed

Lines changed: 20 additions & 16 deletions

File tree

src/ex_cmds2.c

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5091,23 +5091,9 @@ ex_language(exarg_T *eap)
50915091
# if defined(FEAT_CMDL_COMPL) || defined(PROTO)
50925092

50935093
static char_u **locales = NULL; /* Array of all available locales */
5094-
static int did_init_locales = FALSE;
5095-
5096-
static void init_locales(void);
5097-
static char_u **find_locales(void);
50985094

5099-
/*
5100-
* Lazy initialization of all available locales.
5101-
*/
5102-
static void
5103-
init_locales(void)
5104-
{
5105-
if (!did_init_locales)
5106-
{
5107-
did_init_locales = TRUE;
5108-
locales = find_locales();
5109-
}
5110-
}
5095+
# ifndef WIN32
5096+
static int did_init_locales = FALSE;
51115097

51125098
/* Return an array of strings for all available locales + NULL for the
51135099
* last element. Return NULL in case of error. */
@@ -5149,6 +5135,22 @@ find_locales(void)
51495135
((char_u **)locales_ga.ga_data)[locales_ga.ga_len] = NULL;
51505136
return (char_u **)locales_ga.ga_data;
51515137
}
5138+
# endif
5139+
5140+
/*
5141+
* Lazy initialization of all available locales.
5142+
*/
5143+
static void
5144+
init_locales(void)
5145+
{
5146+
# ifndef WIN32
5147+
if (!did_init_locales)
5148+
{
5149+
did_init_locales = TRUE;
5150+
locales = find_locales();
5151+
}
5152+
# endif
5153+
}
51525154

51535155
# if defined(EXITFREE) || defined(PROTO)
51545156
void

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+
174,
767769
/**/
768770
173,
769771
/**/

0 commit comments

Comments
 (0)