Merge pull request #7145 from ckelsel/vim-8.0.0174

vim-patch:8.0.0174
This commit is contained in:
James McCoy
2017-08-16 15:16:19 -04:00
committed by GitHub
2 changed files with 16 additions and 11 deletions

View File

@@ -3611,18 +3611,11 @@ void ex_language(exarg_T *eap)
static char_u **locales = NULL; // Array of all available locales
#ifndef WIN32
static bool did_init_locales = false;
/// Lazy initialization of all available locales.
static void init_locales(void)
{
if (!did_init_locales) {
did_init_locales = true;
locales = find_locales();
}
}
// Return an array of strings for all available locales + NULL for the
/// Return an array of strings for all available locales + NULL for the
/// last element. Return NULL in case of error.
static char_u **find_locales(void)
{
@@ -3654,6 +3647,18 @@ static char_u **find_locales(void)
((char_u **)locales_ga.ga_data)[locales_ga.ga_len] = NULL;
return (char_u **)locales_ga.ga_data;
}
#endif
/// Lazy initialization of all available locales.
static void init_locales(void)
{
#ifndef WIN32
if (!did_init_locales) {
did_init_locales = true;
locales = find_locales();
}
#endif
}
# if defined(EXITFREE)
void free_locales(void)