summaryrefslogtreecommitdiff
path: root/src/os_win32.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-02-10 22:06:32 +0100
committerBram Moolenaar <Bram@vim.org>2020-02-10 22:06:32 +0100
commit355757aed6ae2ae5446882570d89f243e4805937 (patch)
treeab4881042a9f6d88c7344394f9df8885d6024404 /src/os_win32.c
parentb3e195cca7b3201b188c1713b64012b1bef4f61f (diff)
downloadvim-git-355757aed6ae2ae5446882570d89f243e4805937.tar.gz
patch 8.2.0239: MS-Windows: 'env' job option does not override existing varsv8.2.0239
Problem: MS-Windows: 'env' job option does not override existing environment variables. (Tim Pope) Solution: Set the environment variables later. (Yasuhiro Matsumoto, closes #5485, closes #5608)
Diffstat (limited to 'src/os_win32.c')
-rw-r--r--src/os_win32.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/os_win32.c b/src/os_win32.c
index 2594aeea5..f394979d6 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -4948,24 +4948,6 @@ win32_build_env(dict_T *env, garray_T *gap, int is_terminal)
if (ga_grow(gap, 1) == FAIL)
return;
- if (base)
- {
- WCHAR *p = (WCHAR*) base;
-
- // for last \0
- if (ga_grow(gap, 1) == FAIL)
- return;
-
- while (*p != 0 || *(p + 1) != 0)
- {
- if (ga_grow(gap, 1) == OK)
- *((WCHAR*)gap->ga_data + gap->ga_len++) = *p;
- p++;
- }
- FreeEnvironmentStrings(base);
- *((WCHAR*)gap->ga_data + gap->ga_len++) = L'\0';
- }
-
if (env != NULL)
{
for (hi = env->dv_hashtab.ht_array; todo > 0; ++hi)
@@ -4997,6 +4979,24 @@ win32_build_env(dict_T *env, garray_T *gap, int is_terminal)
}
}
+ if (base)
+ {
+ WCHAR *p = (WCHAR*) base;
+
+ // for last \0
+ if (ga_grow(gap, 1) == FAIL)
+ return;
+
+ while (*p != 0 || *(p + 1) != 0)
+ {
+ if (ga_grow(gap, 1) == OK)
+ *((WCHAR*)gap->ga_data + gap->ga_len++) = *p;
+ p++;
+ }
+ FreeEnvironmentStrings(base);
+ *((WCHAR*)gap->ga_data + gap->ga_len++) = L'\0';
+ }
+
# if defined(FEAT_CLIENTSERVER) || defined(FEAT_TERMINAL)
{
# ifdef FEAT_CLIENTSERVER