fixed a bug that might cause ikarus to crash in directory-list.
This commit is contained in:
parent
7bacb4a0a5
commit
16284e6545
|
@ -632,7 +632,6 @@ ikrt_directory_list(ikptr filename, ikpcb* pcb){
|
||||||
de = readdir(dir);
|
de = readdir(dir);
|
||||||
if(de == NULL){
|
if(de == NULL){
|
||||||
pcb->root0 = 0;
|
pcb->root0 = 0;
|
||||||
pcb->root1 = 0;
|
|
||||||
ikptr retval = (errno ? ik_errno_to_code() : ac);
|
ikptr retval = (errno ? ik_errno_to_code() : ac);
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -644,6 +643,7 @@ ikrt_directory_list(ikptr filename, ikpcb* pcb){
|
||||||
memcpy((char*)(bv+off_bytevector_data), de->d_name, len+1);
|
memcpy((char*)(bv+off_bytevector_data), de->d_name, len+1);
|
||||||
pcb->root1 = &bv;
|
pcb->root1 = &bv;
|
||||||
ikptr p = ik_safe_alloc(pcb, pair_size) + pair_tag;
|
ikptr p = ik_safe_alloc(pcb, pair_size) + pair_tag;
|
||||||
|
pcb->root1 = 0;
|
||||||
ref(p, off_car) = bv;
|
ref(p, off_car) = bv;
|
||||||
ref(p, off_cdr) = ac;
|
ref(p, off_cdr) = ac;
|
||||||
ac = p;
|
ac = p;
|
||||||
|
|
Loading…
Reference in New Issue