getpwuid(mingw): provide a better default for the user name
commit564be791f33a72d28497420dafbd3b272b9a1380
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 15 Oct 2018 09:47:06 +0000 (15 02:47 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Oct 2018 03:59:57 +0000 (16 12:59 +0900)
tree15e33c63d5997744820bc52bb5fbf38c665eceb6
parent55b6513e730126ce5512a83d2e00dea30971a523
getpwuid(mingw): provide a better default for the user name

We do have the excellent GetUserInfoEx() function to obtain more
detailed information of the current user (if the user is part of a
Windows domain); Let's use it.

Suggested by Lutz Roeder.

To avoid the cost of loading Secur32.dll (even lazily, loading DLLs
takes a non-neglibile amount of time), we use the established technique
to load DLLs only when, and if, needed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c