Fixed generation of default NVR path, should fix the NVR path across configuration file loads.

This commit is contained in:
OBattler
2017-05-06 23:20:32 +02:00
parent 1d93801019
commit 2dc5b2e48a
2 changed files with 3 additions and 2 deletions

View File

@@ -926,9 +926,9 @@ void loadconfig(wchar_t *fn)
}
memset(nvr_path, 0, 2048);
wp = (wchar_t *)config_get_wstring(NULL, "nvr_path", L"nvr");
wp = (wchar_t *)config_get_wstring(NULL, "nvr_path", L"");
if (wp) {
if (wcslen(wp) <= 992) wcscpy(nvr_path, wp);
if (wcslen(wp) && (wcslen(wp) <= 992)) wcscpy(nvr_path, wp);
else
{
append_filename_w(nvr_path, pcempath, L"nvr", 511);

View File

@@ -1851,6 +1851,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
{
config_save(config_file_default);
loadconfig(wopenfilestring);
pclog_w(L"NVR path: %s\n", nvr_path);
mem_resize();
loadbios();
resetpchard();