comparison src/lread.c @ 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 f838ff9a4d39
children c46111ba348b
comparison
equal deleted inserted replaced
16924:231033e9a053 16925:2b35e4ccbb32
1260 length = read1 (readcharfun, pch, first_in_list); 1260 length = read1 (readcharfun, pch, first_in_list);
1261 c = READCHAR; 1261 c = READCHAR;
1262 if (c == '"') 1262 if (c == '"')
1263 { 1263 {
1264 Lisp_Object tmp, val; 1264 Lisp_Object tmp, val;
1265 int size_in_chars = ((XFASTINT (length) + BITS_PER_CHAR) 1265 int size_in_chars = ((XFASTINT (length) + BITS_PER_CHAR - 1)
1266 / BITS_PER_CHAR); 1266 / BITS_PER_CHAR);
1267 1267
1268 UNREAD (c); 1268 UNREAD (c);
1269 tmp = read1 (readcharfun, pch, first_in_list); 1269 tmp = read1 (readcharfun, pch, first_in_list);
1270 if (size_in_chars != XSTRING (tmp)->size) 1270 if (size_in_chars != XSTRING (tmp)->size
1271 /* We used to print 1 char too many
1272 when the number of bits was a multiple of 8.
1273 Accept such input in case it came from an old version. */
1274 && ! (XFASTINT (length)
1275 == (XSTRING (tmp)->size - 1) * BITS_PER_CHAR))
1271 Fsignal (Qinvalid_read_syntax, 1276 Fsignal (Qinvalid_read_syntax,
1272 Fcons (make_string ("#&...", 5), Qnil)); 1277 Fcons (make_string ("#&...", 5), Qnil));
1273 1278
1274 val = Fmake_bool_vector (length, Qnil); 1279 val = Fmake_bool_vector (length, Qnil);
1275 bcopy (XSTRING (tmp)->data, XBOOL_VECTOR (val)->data, 1280 bcopy (XSTRING (tmp)->data, XBOOL_VECTOR (val)->data,