Commit ecf7e0da authored by Egmont Koblinger's avatar Egmont Koblinger

widget: Fix advance_tail if tail is not in the stream

https://bugzilla.gnome.org/show_bug.cgi?id=738964
parent a7419dd8
......@@ -386,16 +386,16 @@ _vte_ring_discard_one_row (VteRing *ring)
ring->start++;
if (G_UNLIKELY (ring->start == ring->writable)) {
_vte_ring_reset_streams (ring, ring->writable);
} else {
} else if (ring->start < ring->writable) {
VteRowRecord record;
_vte_stream_advance_tail (ring->row_stream, ring->start * sizeof (record));
if (G_LIKELY (_vte_ring_read_row_record (ring, &record, ring->start))) {
_vte_stream_advance_tail (ring->text_stream, record.text_start_offset);
_vte_stream_advance_tail (ring->attr_stream, record.attr_start_offset);
}
}
if (ring->start > ring->writable)
} else {
ring->writable = ring->start;
}
}
static void
......
......@@ -464,6 +464,8 @@ _vte_file_stream_advance_tail (VteStream *astream, gsize offset)
{
VteFileStream *stream = (VteFileStream *) astream;
g_assert(offset <= stream->head);
if (offset >= stream->offset[0]) {
stream->offset[1] = stream->offset[0];
stream->offset[0] = stream->head;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment