When using an intermediate temporary stream, copy the behaviour flags from the original stream.
[INTERPRETER] * BUG: When using an intermediate temporary stream, copy the behaviour flags from the original stream.
This commit is contained in:
parent
7cd804982b
commit
2f81de1876
1 changed files with 10 additions and 1 deletions
|
@ -1050,6 +1050,8 @@ static int read_length(STREAM *stream)
|
||||||
|
|
||||||
static STREAM *enter_temp_stream(STREAM *stream)
|
static STREAM *enter_temp_stream(STREAM *stream)
|
||||||
{
|
{
|
||||||
|
STREAM *temp;
|
||||||
|
|
||||||
if (!_temp_stream || stream != CSTREAM_TO_STREAM(_temp_stream))
|
if (!_temp_stream || stream != CSTREAM_TO_STREAM(_temp_stream))
|
||||||
{
|
{
|
||||||
_temp_save = stream;
|
_temp_save = stream;
|
||||||
|
@ -1057,7 +1059,14 @@ static STREAM *enter_temp_stream(STREAM *stream)
|
||||||
|
|
||||||
OBJECT_UNREF(_temp_stream);
|
OBJECT_UNREF(_temp_stream);
|
||||||
_temp_stream = OBJECT_new(CLASS_File, NULL, NULL);
|
_temp_stream = OBJECT_new(CLASS_File, NULL, NULL);
|
||||||
STREAM_open(CSTREAM_TO_STREAM(_temp_stream), NULL, GB_ST_STRING | GB_ST_WRITE);
|
|
||||||
|
temp = CSTREAM_TO_STREAM(_temp_stream);
|
||||||
|
|
||||||
|
STREAM_open(temp, NULL, GB_ST_STRING | GB_ST_WRITE);
|
||||||
|
|
||||||
|
temp->common.swap = stream->common.swap;
|
||||||
|
temp->common.eol = stream->common.eol;
|
||||||
|
temp->common.null_terminated = stream->common.null_terminated;
|
||||||
}
|
}
|
||||||
|
|
||||||
_temp_level++;
|
_temp_level++;
|
||||||
|
|
Loading…
Reference in a new issue