From ae44f7a443877676e3c432099df2e54f06834417 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 11 Nov 1995 23:48:53 +0000 Subject: [PATCH] (Fdocumentation): Reject a file reference at the end of a lambda body. --- src/doc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/doc.c b/src/doc.c index 31ad2ef0d21..9801b961912 100644 --- a/src/doc.c +++ b/src/doc.c @@ -309,10 +309,15 @@ subcommands.)"); else if (EQ (funcar, Qlambda) || EQ (funcar, Qautoload)) { - tem = Fcar (Fcdr (Fcdr (fun))); + Lisp_Object tem1; + tem1 = Fcdr (Fcdr (fun)); + tem = Fcar (tem1); if (STRINGP (tem)) doc = tem; - else if (NATNUMP (tem) || CONSP (tem)) + /* Handle a doc reference--but these never come last + in the function body, so reject them if they are last. */ + else if ((NATNUMP (tem) || CONSP (tem)) + && ! NILP (XCONS (tem1)->cdr)) doc = get_doc_string (tem); else return Qnil; -- 2.39.2