fix empty lists

This commit is contained in:
Vítor Santos Costa 2013-12-08 22:56:20 +00:00
parent adea3bdb24
commit a654907fe1

View File

@ -144,6 +144,13 @@ SkipListCodes(Term *l, Term **tailp, Int *atoms, int *wide)
do_derefa(v,l,derefa_unk,derefa_nonvar);
s = l;
if (*l == TermNil) {
*tailp = l;
*atoms = 0;
*wide = FALSE;
return 0;
}
if ( IsPairTerm(*l) )
{ intptr_t power = 1, lam = 0;
do
@ -468,7 +475,7 @@ read_Text( void *buf, seq_tv_t *inp, encoding_t *enc, int *minimal USES_REGS)
LOCAL_Error_TYPE = gen_type_error( inp->type );
LOCAL_Error_Term = t;
}
} else if (IsPairTerm(t)) {
} else if (IsPairTerm(t) || t == TermNil) {
if (inp->type & (YAP_STRING_CODES|YAP_STRING_ATOMS)) {
inp->type &= (YAP_STRING_CODES|YAP_STRING_ATOMS);
return read_Text( buf, inp, enc, minimal PASS_REGS);