changeset 16925:2b35e4ccbb32

(read1): Round size of bool-vector properly.
author Richard M. Stallman <rms@gnu.org>
date Fri, 24 Jan 1997 05:47:12 +0000
parents 231033e9a053
children 3baea3418dec
files src/lread.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lread.c	Fri Jan 24 03:51:57 1997 +0000
+++ b/src/lread.c	Fri Jan 24 05:47:12 1997 +0000
@@ -1262,12 +1262,17 @@
 	  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));