From abecf0a5f77b34dce555adb8f5f4b7b980a5bd6e Mon Sep 17 00:00:00 2001 From: Lars Persson Date: Tue, 22 Jul 2008 18:52:13 +0000 Subject: Fixed seek problem when cached data is used. svn-id: r33210 --- backends/platform/symbian/src/SymbianOS.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'backends/platform/symbian/src') diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp index 660b0c69ed..f3e1d843f5 100644 --- a/backends/platform/symbian/src/SymbianOS.cpp +++ b/backends/platform/symbian/src/SymbianOS.cpp @@ -627,6 +627,7 @@ int symbian_fseek(FILE* handle, long int offset, int whence) { TSeek seekMode = ESeekStart; TInt pos = offset; + TSymbianFileEntry* entry = ((TSymbianFileEntry*)(handle)); switch(whence) { case SEEK_SET: @@ -634,6 +635,9 @@ int symbian_fseek(FILE* handle, long int offset, int whence) { break; case SEEK_CUR: seekMode = ESeekCurrent; + if(entry->iInputPos != KErrNotFound) { + pos+=(entry->iInputPos - entry->iInputBufferLen); + } break; case SEEK_END: seekMode = ESeekEnd; @@ -641,9 +645,9 @@ int symbian_fseek(FILE* handle, long int offset, int whence) { } - ((TSymbianFileEntry*)(handle))->iInputPos = KErrNotFound; + entry->iInputPos = KErrNotFound; - return ((TSymbianFileEntry*)(handle))->iFileHandle.Seek(seekMode, pos); + return entry->iFileHandle.Seek(seekMode, pos); } void symbian_clearerr(FILE* /*handle*/) { -- cgit v1.2.3