summaryrefslogtreecommitdiff
path: root/src/doc.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2013-05-09 14:30:46 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2013-05-09 14:30:46 -0400
commit759fd76395eb3c4bc8605fdb656d8431b9ca404d (patch)
tree4ff99fc2f1574146ec671c539b9ec3ce3f696536 /src/doc.c
parent027c0f7538ba48f1eca0c8e0c339fb794e7d21e3 (diff)
downloademacs-759fd76395eb3c4bc8605fdb656d8431b9ca404d.tar.gz
* 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.
Diffstat (limited to 'src/doc.c')
-rw-r--r--src/doc.c22
1 files changed, 14 insertions, 8 deletions
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
{