summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2025-05-26 07:14:25 -0700
committerKaz Kylheku <kaz@kylheku.com>2025-05-26 07:14:25 -0700
commit6d00dec84ca7a648d694e8383b7799eef4ae406f (patch)
tree9cecb9344965b02ef1b3f1c5cefb50f0c18baba1
parentd70b55a0023eda8d776f18d224e4487f5e0d484e (diff)
downloadtxr-6d00dec84ca7a648d694e8383b7799eef4ae406f.tar.gz
txr-6d00dec84ca7a648d694e8383b7799eef4ae406f.tar.bz2
txr-6d00dec84ca7a648d694e8383b7799eef4ae406f.zip
streams: seek-stream must fail on extracted string out stream.
* stream.c (string_out_seek): Do the extracted error check so that we fail if the data has already been removed form the stream. There is a test case already for this, which is failing.
-rw-r--r--stream.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/stream.c b/stream.c
index 03269dd6..0fbca432 100644
--- a/stream.c
+++ b/stream.c
@@ -2612,6 +2612,9 @@ static val string_out_seek(val stream, val off, enum strm_whence whence)
val self = lit("seek-stream");
val pos, len = nil;
+ if (so->buf == 0)
+ string_out_extracted_error(stream);
+
while (so->head != so->tail)
string_out_byte_flush(so, stream);