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@gmail.com>
This commit is contained in:
Eric Pouech 2023-04-04 19:09:38 +02:00 committed by Alexandre Julliard
parent 2be535a221
commit 24069aad30

View file

@ -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;