Mercurial > vim
diff src/os_win32.c @ 19362:7894f20668b1 v8.2.0239
patch 8.2.0239: MS-Windows: 'env' job option does not override existing vars
Commit: https://github.com/vim/vim/commit/355757aed6ae2ae5446882570d89f243e4805937
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Feb 10 22:06:32 2020 +0100
patch 8.2.0239: MS-Windows: 'env' job option does not override existing vars
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 10 Feb 2020 22:15:03 +0100 |
parents | 16d538568dc8 |
children | 08f4dc2ba716 |
line wrap: on
line diff
--- a/src/os_win32.c +++ b/src/os_win32.c @@ -4948,24 +4948,6 @@ win32_build_env(dict_T *env, garray_T *g 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 *g } } + 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