[PATCH 2/2] windows.c: use the USERNAME enviroment variable

Lubomir I. Ivanov neolit123 at gmail.com
Wed Oct 9 06:10:12 UTC 2013


From: "Lubomir I. Ivanov" <neolit123 at gmail.com>

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

Signed-off-by: Lubomir I. Ivanov <neolit123 at gmail.com>
---
 windows.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/windows.c b/windows.c
index eaa3894..ff6e2e0 100644
--- a/windows.c
+++ b/windows.c
@@ -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';
-- 
1.7.11.msysgit.0



More information about the subsurface mailing list