aboutsummaryrefslogtreecommitdiffstats
path: root/src/doc.c
diff options
context:
space:
mode:
authorStefan Monnier2013-05-09 14:30:46 -0400
committerStefan Monnier2013-05-09 14:30:46 -0400
commit759fd76395eb3c4bc8605fdb656d8431b9ca404d (patch)
tree4ff99fc2f1574146ec671c539b9ec3ce3f696536 /src/doc.c
parent027c0f7538ba48f1eca0c8e0c339fb794e7d21e3 (diff)
downloademacs-759fd76395eb3c4bc8605fdb656d8431b9ca404d.tar.gz
emacs-759fd76395eb3c4bc8605fdb656d8431b9ca404d.zip
* 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)
215 if (CONSP (filepos)) 215 if (CONSP (filepos))
216 { 216 {
217 int test = 1; 217 int test = 1;
218 if (get_doc_string_buffer[offset - test++] != ' ') 218 /* A dynamic docstring should be either at the very beginning of a "#@
219 return Qnil; 219 comment" or right after a dynamic docstring delimiter (in case we
220 while (get_doc_string_buffer[offset - test] >= '0' 220 pack several such docstrings within the same comment). */
221 && get_doc_string_buffer[offset - test] <= '9') 221 if (get_doc_string_buffer[offset - test] != '\037')
222 test++; 222 {
223 if (get_doc_string_buffer[offset - test++] != '@' 223 if (get_doc_string_buffer[offset - test++] != ' ')
224 || get_doc_string_buffer[offset - test] != '#') 224 return Qnil;
225 return Qnil; 225 while (get_doc_string_buffer[offset - test] >= '0'
226 && get_doc_string_buffer[offset - test] <= '9')
227 test++;
228 if (get_doc_string_buffer[offset - test++] != '@'
229 || get_doc_string_buffer[offset - test] != '#')
230 return Qnil;
231 }
226 } 232 }
227 else 233 else
228 { 234 {