Kirill K. Smirnov : winhelp: Use path of parent helpfile while looking for popup window.
Module: wine Branch: master Commit: 3545dc519e1c526d2c2aa9d3d22dc4dfd6ccf803 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3545dc519e1c526d2c2aa9d3d2... Author: Kirill K. Smirnov <lich(a)math.spbu.ru> Date: Fri Nov 10 19:37:26 2006 +0300 winhelp: Use path of parent helpfile while looking for popup window. --- programs/winhelp/winhelp.c | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c index c1d07ef..8905d6e 100644 --- a/programs/winhelp/winhelp.c +++ b/programs/winhelp/winhelp.c @@ -117,8 +117,25 @@ HLPFILE* WINHELP_LookupHelpFile(LPCSTR l { HLPFILE* hlpfile; char szFullName[MAX_PATH]; + char szAddPath[MAX_PATH]; + char *p; + + /* + * 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; + } - if (!SearchPath(NULL, lpszFile, ".hlp", MAX_PATH, szFullName, NULL)) + /* + * 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)
participants (1)
-
Alexandre Julliard