winhelp: Use path of parent helpfile while looking for popup window.
This commit is contained in:
parent
133477c276
commit
3545dc519e
|
@ -117,8 +117,25 @@ HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile)
|
|||
{
|
||||
HLPFILE* hlpfile;
|
||||
char szFullName[MAX_PATH];
|
||||
char szAddPath[MAX_PATH];
|
||||
char *p;
|
||||
|
||||
if (!SearchPath(NULL, lpszFile, ".hlp", MAX_PATH, szFullName, NULL))
|
||||
/*
|
||||
* NOTE: This is needed by popup windows only.
|
||||
* In other cases it's not needed but does not hurt though.
|
||||
*/
|
||||
if (Globals.active_win && Globals.active_win->page && Globals.active_win->page->file)
|
||||
{
|
||||
strcpy(szAddPath, Globals.active_win->page->file->lpszPath);
|
||||
p = strrchr(szAddPath, '\\');
|
||||
if (p) *p = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* FIXME: Should we swap conditions?
|
||||
*/
|
||||
if (!SearchPath(NULL, lpszFile, ".hlp", MAX_PATH, szFullName, NULL) &&
|
||||
!SearchPath(szAddPath, lpszFile, ".hlp", MAX_PATH, szFullName, NULL))
|
||||
{
|
||||
if (WINHELP_MessageBoxIDS_s(STID_FILE_NOT_FOUND_s, lpszFile, STID_WHERROR,
|
||||
MB_YESNO|MB_ICONQUESTION) != IDYES)
|
||||
|
|
Loading…
Reference in New Issue