Module: wine Branch: master Commit: d3fd3d73be8c9da238fba091f381104d49aa5a46 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d3fd3d73be8c9da238fba091f3...
Author: Eric Pouech eric.pouech@orange.fr Date: Sun Jul 31 08:53:34 2011 +0200
winhlp32: Better protect macros against not finding a help file.
---
programs/winhlp32/macro.c | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/programs/winhlp32/macro.c b/programs/winhlp32/macro.c index 7f3328f..0a1642c 100644 --- a/programs/winhlp32/macro.c +++ b/programs/winhlp32/macro.c @@ -575,11 +575,11 @@ void CALLBACK MACRO_JumpContext(LPCSTR lpszPath, LPCSTR lpszWindow, LONG context HLPFILE* hlpfile;
WINE_TRACE("("%s", "%s", %d)\n", lpszPath, lpszWindow, context); - hlpfile = WINHELP_LookupHelpFile(lpszPath); - /* Some madness: what user calls 'context', hlpfile calls 'map' */ - WINHELP_OpenHelpWindow(HLPFILE_PageByMap, hlpfile, context, - WINHELP_GetWindowInfo(hlpfile, lpszWindow), - SW_NORMAL); + if ((hlpfile = WINHELP_LookupHelpFile(lpszPath))) + /* Some madness: what user calls 'context', hlpfile calls 'map' */ + WINHELP_OpenHelpWindow(HLPFILE_PageByMap, hlpfile, context, + WINHELP_GetWindowInfo(hlpfile, lpszWindow), + SW_NORMAL); }
void CALLBACK MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash) @@ -591,9 +591,10 @@ void CALLBACK MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash) hlpfile = MACRO_CurrentWindow()->page->file; else hlpfile = WINHELP_LookupHelpFile(lpszPath); - WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, lHash, - WINHELP_GetWindowInfo(hlpfile, lpszWindow), - SW_NORMAL); + if (hlpfile) + WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, lHash, + WINHELP_GetWindowInfo(hlpfile, lpszWindow), + SW_NORMAL); }
static void CALLBACK MACRO_JumpHelpOn(void)