Module: wine Branch: master Commit: 24069aad307829c710f4eaee5aa2b35586bd7f14 URL: https://gitlab.winehq.org/wine/wine/-/commit/24069aad307829c710f4eaee5aa2b35... Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Apr 4 19:09:38 2023 +0200 winedbg: Don't crash when no search path has been set. Note: it's anyway wrong to search source files inside modules' path (a proper fix will require revisiting source file handling). This fix will actually be sufficient when running wine from within its build tree. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> --- programs/winedbg/source.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/programs/winedbg/source.c b/programs/winedbg/source.c index 044eccaab5e..74f31d986c6 100644 --- a/programs/winedbg/source.c +++ b/programs/winedbg/source.c @@ -122,17 +122,18 @@ static BOOL source_locate_file(const char* srcfile, char* path) strcpy(path, srcfile); found = TRUE; } - else if (dbg_curr_process->search_path) + else { const char* spath; - + const char* sp = dbg_curr_process->search_path; + if (!sp) sp = "."; spath = srcfile; while (!found) { while (*spath && *spath != '/' && *spath != '\\') spath++; if (!*spath) break; spath++; - found = SearchPathA(dbg_curr_process->search_path, spath, NULL, MAX_PATH, path, NULL); + found = SearchPathA(sp, spath, NULL, MAX_PATH, path, NULL); } } return found;