diff options
author | Karsten Blees <blees@dcon.de> | 2014-07-17 17:37:56 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-21 09:32:48 -0700 |
commit | b729f98fa50b10cfba7cbf3f37a0ac255e1fbdcd (patch) | |
tree | b501979027cd75249e5dddec7712ec5ebf14b240 /commit-slab.h | |
parent | Win32: Unicode environment (outgoing) (diff) | |
download | tgif-b729f98fa50b10cfba7cbf3f37a0ac255e1fbdcd.tar.xz |
Win32: Unicode environment (incoming)
Convert environment from UTF-16 to UTF-8 on startup.
No changes to getenv() are necessary, as the MSVCRT version is implemented
on top of char **environ.
However, putenv / _wputenv from MSVCRT no longer work, for two reasons:
1. they try to keep environ, _wenviron and the Win32 process environment
in sync, using the default system encoding instead of UTF-8 to convert
between charsets
2. msysgit and MSVCRT use different allocators, memory allocated in git
cannot be freed by the CRT and vice versa
Implement mingw_putenv using the env_setenv helper function from the
environment merge code.
Note that in case of memory allocation failure, putenv now dies with error
message (due to xrealloc) instead of failing with ENOMEM. As git assumes
setenv / putenv to always succeed, this prevents it from continuing with
incorrect settings.
Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-slab.h')
0 files changed, 0 insertions, 0 deletions