diff options
author | Lars Persson | 2008-07-22 18:52:13 +0000 |
---|---|---|
committer | Lars Persson | 2008-07-22 18:52:13 +0000 |
commit | abecf0a5f77b34dce555adb8f5f4b7b980a5bd6e (patch) | |
tree | d5f1ca2b566dfa2fb87f45b87ec0c6c538226697 /backends | |
parent | b422f0ba734190ed5807f4fcf58aee3bf9b6f49e (diff) | |
download | scummvm-rg350-abecf0a5f77b34dce555adb8f5f4b7b980a5bd6e.tar.gz scummvm-rg350-abecf0a5f77b34dce555adb8f5f4b7b980a5bd6e.tar.bz2 scummvm-rg350-abecf0a5f77b34dce555adb8f5f4b7b980a5bd6e.zip |
Fixed seek problem when cached data is used.
svn-id: r33210
Diffstat (limited to 'backends')
-rw-r--r-- | backends/platform/symbian/src/SymbianOS.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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*/) { |