Don't bail out if the prefs isn't found

This commit is contained in:
simon.kagstrom 2010-02-08 17:56:32 +00:00
parent 80239a0b5d
commit e2dcd7475a
2 changed files with 12 additions and 4 deletions

View File

@ -51,8 +51,14 @@ Prefs::Prefs()
ScalingNumerator = 2; ScalingNumerator = 2;
ScalingDenominator = 2; ScalingDenominator = 2;
#if defined(GEKKO)
strcpy(BasePath, "/frodo/");
strcpy(PrefsPath, "/frodo/");
#else
strcpy(BasePath, ""); strcpy(BasePath, "");
strcpy(PrefsPath, ""); strcpy(PrefsPath, "");
#endif
strcpy(DrivePath[0], "64prgs"); strcpy(DrivePath[0], "64prgs");
strcpy(DrivePath[1], ""); strcpy(DrivePath[1], "");
strcpy(DrivePath[2], ""); strcpy(DrivePath[2], "");

View File

@ -221,12 +221,14 @@ void Frodo::LoadFrodorc()
} }
free((void*)p); free((void*)p);
} }
panic_if(!total_name,
"Cannot find frodorc or frodorc.default in any tried directory");
// Load preferences // Load preferences
ThePrefs.Load(total_name); if (total_name)
strncpy(ThePrefs.PrefsPath, prefs_path, sizeof(ThePrefs.PrefsPath)); {
ThePrefs.Load(total_name);
strncpy(ThePrefs.PrefsPath, prefs_path, sizeof(ThePrefs.PrefsPath));
} else
warning("Cannot find frodorc or frodorc.default in any tried directory");
free((void*)total_name); free((void*)total_name);
} }