From 759fd76395eb3c4bc8605fdb656d8431b9ca404d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 9 May 2013 14:30:46 -0400 Subject: * src/doc.c (get_doc_string): Slightly relax the sanity checking. * src/lread.c (skip_dyn_eof): New function. (read1): Use it to skip the end of a file in response to #@00. --- src/doc.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/doc.c') diff --git a/src/doc.c b/src/doc.c index 7234fb38bf9..770cb1eb646 100644 --- a/src/doc.c +++ b/src/doc.c @@ -215,14 +215,20 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition) if (CONSP (filepos)) { int test = 1; - if (get_doc_string_buffer[offset - test++] != ' ') - return Qnil; - while (get_doc_string_buffer[offset - test] >= '0' - && get_doc_string_buffer[offset - test] <= '9') - test++; - if (get_doc_string_buffer[offset - test++] != '@' - || get_doc_string_buffer[offset - test] != '#') - return Qnil; + /* A dynamic docstring should be either at the very beginning of a "#@ + comment" or right after a dynamic docstring delimiter (in case we + pack several such docstrings within the same comment). */ + if (get_doc_string_buffer[offset - test] != '\037') + { + if (get_doc_string_buffer[offset - test++] != ' ') + return Qnil; + while (get_doc_string_buffer[offset - test] >= '0' + && get_doc_string_buffer[offset - test] <= '9') + test++; + if (get_doc_string_buffer[offset - test++] != '@' + || get_doc_string_buffer[offset - test] != '#') + return Qnil; + } } else { -- cgit v1.2.1