summaryrefslogtreecommitdiff
path: root/src/lread.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@gnu.org>2013-05-23 00:12:59 +0900
committerKenichi Handa <handa@gnu.org>2013-05-23 00:12:59 +0900
commite1b96d7e637cf76864013f8dba68135f07638ab8 (patch)
tree1a2ccd5961a60f0268a37444071e8cd7a2255fbc /src/lread.c
parente6d2f1553635a746396f2f4261dde31e03e0fdd1 (diff)
parent5d0acd9d3bb26adfac1c80b78aa48dc8b2d34fe0 (diff)
downloademacs-e1b96d7e637cf76864013f8dba68135f07638ab8.tar.gz
emacs-e1b96d7e637cf76864013f8dba68135f07638ab8.tar.bz2
emacs-e1b96d7e637cf76864013f8dba68135f07638ab8.zip
merge trunk
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/lread.c b/src/lread.c
index 272f252cf7b..3ca644bb45b 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -378,6 +378,19 @@ skip_dyn_bytes (Lisp_Object readcharfun, ptrdiff_t n)
}
}
+static void
+skip_dyn_eof (Lisp_Object readcharfun)
+{
+ if (FROM_FILE_P (readcharfun))
+ {
+ block_input (); /* FIXME: Not sure if it's needed. */
+ fseek (instream, 0, SEEK_END);
+ unblock_input ();
+ }
+ else
+ while (READCHAR >= 0);
+}
+
/* Unread the character C in the way appropriate for the stream READCHARFUN.
If the stream is a user function, call it with the char as argument. */
@@ -2622,7 +2635,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
if (c == '@')
{
enum { extra = 100 };
- ptrdiff_t i, nskip = 0;
+ ptrdiff_t i, nskip = 0, digits = 0;
/* Read a decimal integer. */
while ((c = READCHAR) >= 0
@@ -2630,8 +2643,14 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
{
if ((STRING_BYTES_BOUND - extra) / 10 <= nskip)
string_overflow ();
+ digits++;
nskip *= 10;
nskip += c - '0';
+ if (digits == 2 && nskip == 0)
+ { /* We've just seen #@00, which means "skip to end". */
+ skip_dyn_eof (readcharfun);
+ return Qnil;
+ }
}
if (nskip > 0)
/* We can't use UNREAD here, because in the code below we side-step
@@ -3538,7 +3557,7 @@ read_list (bool flag, Lisp_Object readcharfun)
{
if (NILP (Vdoc_file_name))
/* We have not yet called Snarf-documentation, so assume
- this file is described in the DOC-MM.NN file
+ this file is described in the DOC file
and Snarf-documentation will fill in the right value later.
For now, replace the whole list with 0. */
doc_reference = 1;