COPY-READTABLE did not copy entries when supplied a second argument.

This commit is contained in:
jgarcia 2007-03-24 10:18:00 +00:00
parent 4f2de9b275
commit 7726d09262
2 changed files with 9 additions and 8 deletions

View file

@ -139,6 +139,8 @@ ECL 1.0:
(defun print-it-1 ()
(print (get-it)))))
- COPY-READTABLE did not copy entries when supplied a second argument.
* Unicode:
- MAKE-STRING only allowed :ELEMENT-TYPE to be one of CHARACTER, BASE-CHAR, or

View file

@ -1292,28 +1292,26 @@ ecl_copy_readtable(cl_object from, cl_object to)
{
struct ecl_readtable_entry *rtab;
cl_index i;
size_t entry_bytes = sizeof(struct ecl_readtable_entry);
size_t total_bytes = entry_bytes * RTABSIZE;
/* Copy also the case for reading */
if (Null(to)) {
to = cl_alloc_object(t_readtable);
to->readtable.table = NULL;
/* Saving for GC. */
to->readtable.table
= rtab
= (struct ecl_readtable_entry *)cl_alloc_align(RTABSIZE * sizeof(struct ecl_readtable_entry), sizeof(struct ecl_readtable_entry));
memcpy(rtab, from->readtable.table,
RTABSIZE * sizeof(struct ecl_readtable_entry));
to->readtable.table = (struct ecl_readtable_entry *)cl_alloc_align(total_bytes, entry_bytes);
/*
for (i = 0; i < RTABSIZE; i++)
rtab[i] = from->readtable.table[i];
*/
/* structure assignment */
} else {
rtab=to->readtable.table;
}
rtab=to->readtable.table;
memcpy(rtab, from->readtable.table, total_bytes);
to->readtable.read_case = from->readtable.read_case;
for (i = 0; i < RTABSIZE; i++)
for (i = 0; i < RTABSIZE; i++) {
if (from->readtable.table[i].dispatch_table != NULL) {
rtab[i].dispatch_table
= (cl_object *)cl_alloc_align(RTABSIZE * sizeof(cl_object), sizeof(cl_object));
@ -1325,6 +1323,7 @@ ecl_copy_readtable(cl_object from, cl_object to)
= from->readtable.table[i].dispatch_table[j];
*/
}
}
return(to);
}