From 379f690438d52d72e89f075933a2ff9b16ba44b5 Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Tue, 11 Aug 2009 12:09:46 +0000 Subject: [PATCH] git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3960 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/Main.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index fdbd8cf9c2..178f69dd82 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -124,7 +124,7 @@ bool DolphinApp::OnInit() } #ifndef __APPLE__ // Keep the user config dir free unless user wants to save the working dir - if (File::Exists(FULL_CONFIG_DIR "portable")) + if (!File::Exists(FULL_CONFIG_DIR "portable")) { char tmp[1024]; sprintf(tmp, "%s/.dolphin%swd", (const char*)wxStandardPaths::Get().GetUserConfigDir().mb_str(), @@ -143,6 +143,7 @@ bool DolphinApp::OnInit() { PanicAlert("Portable Setting could not be saved\n Are you running Dolphin from read only media or from a directory that dolphin is not located in?"); } + fclose(portable); } else { @@ -151,7 +152,8 @@ bool DolphinApp::OnInit() if (PanicYesNo("Set install location to:\n %s ?", CWD)) { FILE* workingDirF = fopen(tmp, "w"); - if (!workingDirF) PanicAlert("Install directory could not be saved"); + if (!workingDirF) + PanicAlert("Install directory could not be saved"); else { fwrite(CWD, ((std::string)CWD).size()+1, 1, workingDirF); @@ -159,16 +161,17 @@ bool DolphinApp::OnInit() fclose(workingDirF); } } - else PanicAlert("Relaunch Dolphin from the install directory and save from there"); + else + PanicAlert("Relaunch Dolphin from the install directory and save from there"); } } else { char *tmpChar; long len; - fseek(workingDir,0,SEEK_END); - len=ftell(workingDir); - fseek(workingDir,0,SEEK_SET); + fseek(workingDir, 0, SEEK_END); + len = ftell(workingDir); + fseek(workingDir, 0, SEEK_SET); tmpChar = new char[len]; fread(tmpChar, len, 1, workingDir); fclose(workingDir);