Skip to content

Commit

Permalink
Make write_term/1 and friends fail immediately if a blob write sets t…
Browse files Browse the repository at this point in the history
…he stream

in error state.
  • Loading branch information
JanWielemaker committed Aug 9, 2023
1 parent b77380b commit d49b1d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pl-write.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,8 @@ writeAtom(atom_t a, write_options *options)
}

if ( atom->type->write )
return (*atom->type->write)(options->out, a, options->flags);
return ((*atom->type->write)(options->out, a, options->flags) &&
!Sferror(options->out));
if ( false(atom->type, PL_BLOB_TEXT) )
return writeBlob(a, options);

Expand Down

0 comments on commit d49b1d7

Please sign in to comment.