Skip to content

Commit

Permalink
Do not reset config to default if config file can't be opened.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonioni committed Apr 23, 2024
1 parent beb2028 commit 8c4bc7b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion od-win32/win32gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4249,7 +4249,24 @@ static TCHAR *HandleConfiguration (HWND hDlg, int flag, struct ConfigStruct *con
TCHAR szMessage[MAX_DPATH];
WIN32GUI_LoadUIString (IDS_MUSTSELECTCONFIG, szMessage, MAX_DPATH);
pre_gui_message (szMessage);
} else {
ok = 0;
}
if (ok && !zfile_exists(path)) {
TCHAR fname[MAX_DPATH];
fetch_configurationpath(fname, sizeof(fname) / sizeof(TCHAR));
if (_tcsncmp(fname, path, _tcslen(fname)))
_tcscat(fname, path);
else
_tcscpy(fname, path);
if (!zfile_exists(fname)) {
TCHAR szMessage[MAX_DPATH];
WIN32GUI_LoadUIString(IDS_COULDNOTLOADCONFIG, szMessage, MAX_DPATH);
pre_gui_message(szMessage);
config_filename[0] = 0;
ok = 0;
}
}
if (ok) {
if (target_cfgfile_load (&workprefs, path, configtypepanel, 0) == 0) {
TCHAR szMessage[MAX_DPATH];
WIN32GUI_LoadUIString (IDS_COULDNOTLOADCONFIG, szMessage, MAX_DPATH);
Expand Down

0 comments on commit 8c4bc7b

Please sign in to comment.