BaseTools: FMMT replace output file is not generated successfully

For replace function, when target Ffs and new ffs are with
same size, the output file can not be generated successfully.
This patch fixes this issue.

Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
Yuwei Chen
2023-06-29 11:34:48 +08:00
committed by mergify[bot]
parent b5f5106c1e
commit 9627447625
2 changed files with 18 additions and 5 deletions

View File

@ -56,7 +56,7 @@ class BIOSTREE:
if len(self.Child) == 0:
self.Child.append(newNode)
else:
if not pos:
if not pos or pos == len(self.Child):
LastTree = self.Child[-1]
self.Child.append(newNode)
LastTree.NextRel = newNode
@ -195,4 +195,4 @@ class BIOSTREE:
for item in self.Child:
TreeInfo[key].setdefault('Files',[]).append( item.ExportTree())
return TreeInfo
return TreeInfo