From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A8A0B21CAD9B0 for ; Mon, 3 Jul 2017 01:46:08 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP; 03 Jul 2017 01:47:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,302,1496127600"; d="scan'208";a="103928097" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by orsmga004.jf.intel.com with ESMTP; 03 Jul 2017 01:47:44 -0700 From: Yonghong Zhu To: edk2-devel@lists.01.org Cc: Yunhua Feng , Liming Gao Date: Mon, 3 Jul 2017 16:47:28 +0800 Message-Id: <1499071648-24832-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [PATCH] BaseTools: Fix FDF file parse !include file issue X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jul 2017 08:46:08 -0000 From: Yunhua Feng 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 --- BaseTools/Source/Python/GenFds/FdfParser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index a1825baac7..028ba33eb6 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() -- 2.12.2.windows.2