summaryrefslogtreecommitdiff
path: root/src/ex_cmds2.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-01-12 20:28:25 +0100
committerBram Moolenaar <Bram@vim.org>2017-01-12 20:28:25 +0100
commitb8f7bd68f6fdff51ca4db5b145dcde42ee7b804b (patch)
tree6b3315e3bd54512e79c1e3858bea9016bb1b27f0 /src/ex_cmds2.c
parenta1fa8929395351f03c56f50ca6e891d825123c0f (diff)
downloadvim-b8f7bd68f6fdff51ca4db5b145dcde42ee7b804b.zip
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)
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r--src/ex_cmds2.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index bee467052..7a6047a5b 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -5091,23 +5091,9 @@ ex_language(exarg_T *eap)
# if defined(FEAT_CMDL_COMPL) || defined(PROTO)
static char_u **locales = NULL; /* Array of all available locales */
-static int did_init_locales = FALSE;
-
-static void init_locales(void);
-static char_u **find_locales(void);
-/*
- * Lazy initialization of all available locales.
- */
- static void
-init_locales(void)
-{
- if (!did_init_locales)
- {
- did_init_locales = TRUE;
- locales = find_locales();
- }
-}
+# ifndef WIN32
+static int did_init_locales = FALSE;
/* Return an array of strings for all available locales + NULL for the
* last element. Return NULL in case of error. */
@@ -5149,6 +5135,22 @@ 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) || defined(PROTO)
void