mirror of https://github.com/MidnightCommander/mc
* help.c (help_index_cmd): Eliminate unneeded search for
"[Help]", which always fails. Fix crash if "[Contents]" cannot be found. Reuse more generic error message.
This commit is contained in:
parent
52caab36b8
commit
afae5939cd
|
@ -1,5 +1,9 @@
|
|||
2002-09-03 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* help.c (help_index_cmd): Eliminate unneeded search for
|
||||
"[Help]", which always fails. Fix crash if "[Contents]" cannot
|
||||
be found. Reuse more generic error message.
|
||||
|
||||
* filegui.c: Eliminate x_set_dialog_title().
|
||||
* hotlist.c: Likewise.
|
||||
* help.c: Likewise.
|
||||
|
|
20
src/help.c
20
src/help.c
|
@ -556,19 +556,21 @@ help_help_cmd (Dlg_head *h)
|
|||
}
|
||||
|
||||
static void
|
||||
help_index_cmd (Dlg_head *h)
|
||||
help_index_cmd (Dlg_head * h)
|
||||
{
|
||||
char *new_item;
|
||||
|
||||
history_ptr = (history_ptr+1) % HISTORY_SIZE;
|
||||
history [history_ptr].page = currentpoint;
|
||||
history [history_ptr].link = selected_item;
|
||||
currentpoint = startpoint = search_string (data, "[Help]") + 1;
|
||||
if (!(new_item = search_string (data, "[Contents]"))) {
|
||||
message (1, MSG_ERROR, _(" Cannot find node %s in help file "),
|
||||
"[Contents]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(new_item = search_string (data, "[Contents]")))
|
||||
message (1, MSG_ERROR, _(" Cannot find node [Contents] in help file "));
|
||||
else
|
||||
currentpoint = startpoint = new_item + 1;
|
||||
history_ptr = (history_ptr + 1) % HISTORY_SIZE;
|
||||
history[history_ptr].page = currentpoint;
|
||||
history[history_ptr].link = selected_item;
|
||||
|
||||
currentpoint = startpoint = new_item + 1;
|
||||
selected_item = NULL;
|
||||
help_callback (h, 0, DLG_DRAW);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue