Commit 24069aad authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

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: 's avatarEric Pouech <eric.pouech@gmail.com>
parent 2be535a2
...@@ -122,17 +122,18 @@ static BOOL source_locate_file(const char* srcfile, char* path) ...@@ -122,17 +122,18 @@ static BOOL source_locate_file(const char* srcfile, char* path)
strcpy(path, srcfile); strcpy(path, srcfile);
found = TRUE; found = TRUE;
} }
else if (dbg_curr_process->search_path) else
{ {
const char* spath; const char* spath;
const char* sp = dbg_curr_process->search_path;
if (!sp) sp = ".";
spath = srcfile; spath = srcfile;
while (!found) while (!found)
{ {
while (*spath && *spath != '/' && *spath != '\\') spath++; while (*spath && *spath != '/' && *spath != '\\') spath++;
if (!*spath) break; if (!*spath) break;
spath++; 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; return found;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment