From: Richard M. Stallman Date: Fri, 24 Jan 1997 05:47:12 +0000 (+0000) Subject: (read1): Round size of bool-vector properly. X-Git-Tag: emacs-20.1~3019 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=90ed3ec5e7bec48666ccaab662b923eabcb77bd8;p=emacs.git (read1): Round size of bool-vector properly. --- diff --git a/src/lread.c b/src/lread.c index 8c3a0e5d9b0..55904b96b4f 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1262,12 +1262,17 @@ read1 (readcharfun, pch, first_in_list) if (c == '"') { Lisp_Object tmp, val; - int size_in_chars = ((XFASTINT (length) + BITS_PER_CHAR) + int size_in_chars = ((XFASTINT (length) + BITS_PER_CHAR - 1) / BITS_PER_CHAR); UNREAD (c); tmp = read1 (readcharfun, pch, first_in_list); - if (size_in_chars != XSTRING (tmp)->size) + if (size_in_chars != XSTRING (tmp)->size + /* We used to print 1 char too many + when the number of bits was a multiple of 8. + Accept such input in case it came from an old version. */ + && ! (XFASTINT (length) + == (XSTRING (tmp)->size - 1) * BITS_PER_CHAR)) Fsignal (Qinvalid_read_syntax, Fcons (make_string ("#&...", 5), Qnil));