amicommon: backported seeking fixes from AROS branch, which actually apply to all Am*ga platforms

git-svn-id: trunk@28516 -
This commit is contained in:
Károly Balogh 2014-08-24 14:56:36 +00:00
parent 0539923b68
commit cba1962284
2 changed files with 5 additions and 4 deletions

View File

@ -273,7 +273,7 @@ begin
if dosResult<0 then begin
dosError2InOut(IoErr);
end else begin
do_seekend:=dosResult;
do_seekend:=dosSeek(handle,0,OFFSET_CURRENT);
end;
end;
end;
@ -286,8 +286,6 @@ begin
if CheckInList(ASYS_fileList,handle)<>nil then begin
currfilepos:=do_filepos(handle);
{ We have to do this twice, because seek returns the OLD position }
do_filesize:=do_seekend(handle);
do_filesize:=do_seekend(handle);
do_seek(handle,currfilepos);

View File

@ -267,7 +267,10 @@ begin
fsFromEnd : seekMode:=OFFSET_END;
end;
FileSeek:=dosSeek(Handle, FOffset, seekMode);
dosSeek(Handle, FOffset, seekMode);
{ get the current position when FileSeek ends, which should return
the *NEW* position, while Amiga Seek() returns the old one }
FileSeek:=dosSeek(Handle, 0, OFFSET_CURRENT);
end;
function FileSeek(Handle: LongInt; FOffset: Int64; Origin: Longint): Int64;