Module: wine Branch: master Commit: 25b79fafe335eaf58563093f3a4e493a0e2ecfcf URL: http://source.winehq.org/git/wine.git/?a=commit;h=25b79fafe335eaf58563093f3a...
Author: Eric Pouech eric.pouech@orange.fr Date: Sat Jun 21 10:50:26 2008 +0200
winhelp: Properly quit winhelp when no file are given on command line.
---
programs/winhlp32/winhelp.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/programs/winhlp32/winhelp.c b/programs/winhlp32/winhelp.c index 3b8f173..f5d512b 100644 --- a/programs/winhlp32/winhelp.c +++ b/programs/winhlp32/winhelp.c @@ -376,6 +376,13 @@ typedef struct WORD ofsData; } WINHELP,*LPWINHELP;
+static BOOL WINHELP_HasWorkingWindow(void) +{ + if (!Globals.active_win) return FALSE; + if (Globals.active_win->next || Globals.win_list != Globals.active_win) return TRUE; + return Globals.active_win->page != NULL && Globals.active_win->page->file != NULL; +} + /****************************************************************** * WINHELP_HandleCommand * @@ -407,6 +414,7 @@ static LRESULT WINHELP_HandleCommand(HWND hSrcWnd, LPARAM lParam) { MACRO_JumpContext(ptr, "main", wh->data); } + if (!WINHELP_HasWorkingWindow()) MACRO_Exit(); break; case HELP_QUIT: MACRO_Exit(); @@ -416,9 +424,11 @@ static LRESULT WINHELP_HandleCommand(HWND hSrcWnd, LPARAM lParam) { MACRO_JumpContents(ptr, "main"); } + if (!WINHELP_HasWorkingWindow()) MACRO_Exit(); break; case HELP_HELPONHELP: MACRO_HelpOn(); + if (!WINHELP_HasWorkingWindow()) MACRO_Exit(); break; /* case HELP_SETINDEX: */ case HELP_SETCONTENTS: