This commit is contained in:
Vitor Santos Costa
2018-08-07 17:25:05 +01:00
parent e455d6cc6a
commit 6cdd35b6e1
2 changed files with 28 additions and 19 deletions

View File

@@ -445,6 +445,13 @@ unsigned char *Yap_readText(seq_tv_t *inp USES_REGS) {
Yap_ThrowError(LOCAL_Error_TYPE, inp->val.t, "while reading text in");
}
}
if ((inp->val.t == TermNil) && inp->type & YAP_STRING_PREFER_LIST )
{
out = Malloc(4);
memset(out, 0, 4);
POPRET( out );
}
if (IsAtomTerm(inp->val.t) && inp->type & YAP_STRING_ATOM) {
// this is a term, extract to a buffer, and representation is wide
// Yap_DebugPlWriteln(inp->val.t);