This commit is contained in:
Vítor Santos Costa
2018-04-02 14:49:45 +01:00
parent 48bcffdce7
commit c1d81ea7c6
28 changed files with 1237 additions and 1059 deletions

View File

@@ -1255,11 +1255,11 @@ char *Yap_TermToBuffer(Term t, encoding_t enc, int flags) {
CACHE_REGS
int sno = Yap_open_buf_write_stream(enc, flags);
const char *sf;
DBTerm *e = LOCAL_BallTerm;
yap_error_descriptor_t ne;
if (sno < 0)
return NULL;
LOCAL_c_output_stream = sno;
Yap_pushErrorContext(&ne);
if (enc)
GLOBAL_Stream[sno].encoding = enc;
else
@@ -1271,7 +1271,6 @@ char *Yap_TermToBuffer(Term t, encoding_t enc, int flags) {
char *new = malloc(len + 1);
strcpy(new, sf);
Yap_CloseStream(sno);
if (e)
LOCAL_BallTerm = e;
Yap_popErrorContext (true);
return new;
}