BaseTools: Fix FDF file parse !include file issue

when FDF file use "!include" format to include the other file,
and the end line of the file not end with '\n', the include
file parse error.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Yunhua Feng 2017-06-28 18:29:18 +08:00 committed by Yonghong Zhu
parent bc0d723392
commit 47a29bc707
1 changed files with 4 additions and 0 deletions

View File

@ -167,6 +167,10 @@ class IncludeFileProfile :
fsock = open(FileName, "rb", 0)
try:
self.FileLinesList = fsock.readlines()
for index, line in enumerate(self.FileLinesList):
if not line.endswith('\n'):
self.FileLinesList[index] += '\n'
finally:
fsock.close()