windows.c: use the USERNAME enviroment variable

system_default_filename():
Use USERNAME, which should work for Windows XP and above.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lubomir I. Ivanov 2013-10-09 16:10:12 +03:00 committed by Dirk Hohndel
parent 4fee6077af
commit 0b5b671dd9

View file

@ -15,7 +15,7 @@ const char *system_default_filename(void)
int len;
/* I don't think this works on Windows */
user = getenv("LOGNAME");
user = getenv("USERNAME");
if (! SUCCEEDED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, datapath))) {
datapath[0] = '.';
datapath[1] = '\0';