diff options
| author | Stefan Monnier | 2013-05-09 14:30:46 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-05-09 14:30:46 -0400 |
| commit | 759fd76395eb3c4bc8605fdb656d8431b9ca404d (patch) | |
| tree | 4ff99fc2f1574146ec671c539b9ec3ce3f696536 /src/doc.c | |
| parent | 027c0f7538ba48f1eca0c8e0c339fb794e7d21e3 (diff) | |
| download | emacs-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.c | 22 |
1 files changed, 14 insertions, 8 deletions
| @@ -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 | { |