From 47a29bc7072b20d465ccfd634b74121a67368c4f Mon Sep 17 00:00:00 2001 From: Yunhua Feng Date: Wed, 28 Jun 2017 18:29:18 +0800 Subject: 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 Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yunhua Feng Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/GenFds/FdfParser.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'BaseTools') diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index 2782be4b98..8f49f9faad 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -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() -- cgit v1.2.3