From 16634a472097c00e44cb9aea1560807181bba133 Mon Sep 17 00:00:00 2001 From: Aizal Khan Date: Fri, 3 Jul 2026 19:52:08 +0530 Subject: [PATCH] bound help index section comment strip to section buffer --- cgi-bin/help-index.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cgi-bin/help-index.c b/cgi-bin/help-index.c index 9dbc23cb7b..e9dceb38c5 100644 --- a/cgi-bin/help-index.c +++ b/cgi-bin/help-index.c @@ -887,10 +887,9 @@ help_load_file( * Strip comment stuff from end of line... */ - for (*ptr-- = '\0'; ptr > line && isspace(*ptr & 255); *ptr-- = '\0'); - - if (isspace(*ptr & 255)) - *ptr = '\0'; + *ptr = '\0'; + while (ptr > section && isspace(ptr[-1] & 255)) + *--ptr = '\0'; } continue; }