From cc6736afae5b63ba1235d7dfb11a76e97573bdc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Fri, 10 Sep 2021 20:17:22 +0200 Subject: [PATCH] StreamBuffer: fix Position() for read streams MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the file position corresponds to the end of the buffer. Change-Id: Ib67dcfe1f43d959777c2f6dbf84181f25a022a7c Reviewed-on: https://review.haiku-os.org/c/haiku/+/4447 Tested-by: Commit checker robot Reviewed-by: Jérôme Duval --- src/add-ons/translators/shared/StreamBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/add-ons/translators/shared/StreamBuffer.cpp b/src/add-ons/translators/shared/StreamBuffer.cpp index 63f28893c2..3551c1326a 100644 --- a/src/add-ons/translators/shared/StreamBuffer.cpp +++ b/src/add-ons/translators/shared/StreamBuffer.cpp @@ -242,7 +242,7 @@ StreamBuffer::Position() { off_t position = fStream->Position(); if (fToRead) - position -= fPos; + position -= (fLen - fPos); else position += fLen; return position;