MdeModulePkg/UdfDxe: Correct behavior for UdfSetPosition()

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1252

Calling the 'SetPosition' service of the EFI_FILE_PROTOCOL with 'Position'
equals to 0xFFFFFFFFFFFFFFFF for a file is to set the current position to
the end of the file. But the current implementation of function
UdfSetPosition() is to set it to the last byte (not EOF).

This commit will resolve this issue.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Paulo Alcantara <palcantara@suse.de>
Acked-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Hao Wu 2018-10-08 14:04:48 +08:00
parent 3b30351b75
commit 6df465b212
1 changed files with 1 additions and 1 deletions

View File

@ -722,7 +722,7 @@ UdfSetPosition (
// set to the EOF. // set to the EOF.
// //
if (Position == 0xFFFFFFFFFFFFFFFF) { if (Position == 0xFFFFFFFFFFFFFFFF) {
PrivFileData->FilePosition = PrivFileData->FileSize - 1; PrivFileData->FilePosition = PrivFileData->FileSize;
} else { } else {
PrivFileData->FilePosition = Position; PrivFileData->FilePosition = Position;
} }