From b248f6bb32d5bd02c2b855cc23228e1da977f602 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 5 Sep 2002 06:51:46 +0000 Subject: [PATCH] * help.c (help_handle_key): Sanity check for broken help files. From David Martin --- src/ChangeLog | 5 +++++ src/help.c | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a5e0964a5..6afd9397f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-09-05 Pavel Roskin + + * help.c (help_handle_key): Sanity check for broken help files. + From David Martin + 2002-09-03 Pavel Roskin * global.h: Eliminate xgetch, update all dependencies. diff --git a/src/help.c b/src/help.c index 235095c80..9b144d330 100644 --- a/src/help.c +++ b/src/help.c @@ -690,10 +690,13 @@ static int help_handle_key (struct Dlg_head *h, int c) while (*new_item && *new_item != CHAR_NODE_END) new_item++; if (*++new_item == '['){ - while (*new_item != ']') - new_item++; - currentpoint = new_item + 2; - selected_item = NULL; + while (*++new_item) { + if (*new_item == ']' && *++newitem && *++newitem) { + currentpoint = new_item; + selected_item = NULL; + break; + } + } } break;