Eric Pouech : winhlp32: Better protect macros against not finding a help file.
Alexandre Julliard
julliard at winehq.org
Mon Aug 1 13:22:07 CDT 2011
Module: wine
Branch: master
Commit: d3fd3d73be8c9da238fba091f381104d49aa5a46
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d3fd3d73be8c9da238fba091f381104d49aa5a46
Author: Eric Pouech <eric.pouech at 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)
More information about the wine-cvs
mailing list