[FTP] Don't hardcode C: drive (#2767)

CORE-13235
This commit is contained in:
Katayama Hirofumi MZ 2020-05-13 13:42:18 +09:00 committed by GitHub
parent cba5acbc48
commit 278f563e04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -227,7 +227,16 @@ int main(int argc, const char *argv[])
(void) strcpy(home, pw->pw_dir);
}
#endif
strcpy(home, "C:/");
cp = getenv("SystemDrive");
if (cp != NULL && *cp != 0)
{
strcpy(home, cp);
strcat(home, "/");
}
else
{
strcpy(home, "C:/");
}
if (argc > 0) {
if (setjmp(toplevel))
exit(0);