mirror of
https://github.com/libssh2/libssh2.git
synced 2025-08-01 11:26:53 +03:00
tests: teach to use the USERNAME
envvar on Windows
Necessary to pick the correct local username when run on Windows. Cherry-picked from #1017
This commit is contained in:
@ -63,6 +63,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
if(getenv("USER"))
|
||||
username = getenv("USER");
|
||||
#ifdef WIN32
|
||||
else if(getenv("USERNAME"))
|
||||
username = getenv("USERNAME");
|
||||
#endif
|
||||
|
||||
if(getenv("PRIVKEY"))
|
||||
privkey = getenv("PRIVKEY");
|
||||
|
Reference in New Issue
Block a user