From 2dc5b2e48af6a0dab4937c8468850b544622f125 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 6 May 2017 23:20:32 +0200 Subject: [PATCH] Fixed generation of default NVR path, should fix the NVR path across configuration file loads. --- src/pc.c | 4 ++-- src/win.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pc.c b/src/pc.c index bf8036f52..86eb6e364 100644 --- a/src/pc.c +++ b/src/pc.c @@ -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); diff --git a/src/win.c b/src/win.c index 9b85ac8ca..e601e2fb6 100644 --- a/src/win.c +++ b/src/win.c @@ -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();