Windows save path bug fix.

This commit is contained in:
Steve 2016-02-25 12:27:08 +00:00
parent 3f100a0848
commit b5bafa1b1e
1 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ void createSaveFolder(void)
char *userHome; char *userHome;
char dir[MAX_FILENAME_LENGTH]; char dir[MAX_FILENAME_LENGTH];
userHome = getenv("USERNAME"); userHome = getenv("USERPROFILE");
if (!userHome) if (!userHome)
{ {
@ -35,7 +35,7 @@ void createSaveFolder(void)
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "User home = %s", userHome); SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "User home = %s", userHome);
sprintf(dir, "%s/tbftss", userHome); sprintf(dir, "%s\\tbftss", userHome);
if (mkdir(dir) != 0 && errno != EEXIST) if (mkdir(dir) != 0 && errno != EEXIST)
{ {
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, "Failed to create save dir '%s'. Will save to current dir.", dir); SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, "Failed to create save dir '%s'. Will save to current dir.", dir);