Subject: bug#76179: 31.0.50; Error on 'C-h f bindat-type RET'

From: Stefan Monnier <[email-masked]>
Date: Mon, 10 Feb 2025 15:37:15 -0500

Stefan Kangas [2025-02-10 06:38:11] wrote:
> I get an error on 'C-h f bindat-type RET'.

I don't.

> Simple reproducer:
>
>     emacs -Q -batch -eval "(progn (require 'bindat) \
>         (describe-function 'bindat--type))"

This one (with the double dash) does signal an out of bounds error,
indeed.  I just pushed a trivial fix for it to `emacs-30`.

        Stefan

diff --git a/lisp/help.el b/lisp/help.el
index 5d4c3e61599..1d87c2209c8 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -2381,7 +2381,7 @@ help-function-arglist
             (dolist (arg arglist)
               (unless (and (symbolp arg)
                            (let ((name (symbol-name arg)))
-                             (if (eq (aref name 0) ?&)
+                             (if (and (> (length name) 0) (eq (aref name 0) ?&))
                                  (memq arg '(&rest &optional))
                                (not (string-search "." name)))))
                 (setq valid nil)))