aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/symbian/src/SymbianOS.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/symbian/src/SymbianOS.cpp')
-rw-r--r--backends/platform/symbian/src/SymbianOS.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp
index 660b0c69ed..e3a4027d79 100644
--- a/backends/platform/symbian/src/SymbianOS.cpp
+++ b/backends/platform/symbian/src/SymbianOS.cpp
@@ -617,9 +617,13 @@ bool symbian_feof(FILE* handle) {
long int symbian_ftell(FILE* handle) {
TInt pos = 0;
+ TSymbianFileEntry* entry = ((TSymbianFileEntry*)(handle));
- ((TSymbianFileEntry*)(handle))->iFileHandle.Seek(ESeekCurrent, pos);
-
+ entry->iFileHandle.Seek(ESeekCurrent, pos);
+ if(entry->iInputPos != KErrNotFound)
+ {
+ pos+=(entry->iInputPos - entry->iInputBufferLen);
+ }
return pos;
}
@@ -627,6 +631,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 +639,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 +649,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*/) {