1
0
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:
Viktor Szakats
2023-04-30 00:03:16 +00:00
parent 3f3236eb08
commit cda41f7cb8
2 changed files with 10 additions and 1 deletions

View File

@ -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");