mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-30 05:31:39 +00:00
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:
parent
2be535a221
commit
24069aad30
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue