From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 B11A780348 for ; Mon, 6 Mar 2017 22:01:41 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2017 22:01:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,257,1484035200"; d="scan'208";a="831766549" Received: from tiano01.ccr.corp.intel.com ([10.239.9.111]) by FMSMGA003.fm.intel.com with ESMTP; 06 Mar 2017 22:01:40 -0800 From: hesschen To: edk2-devel@lists.01.org Date: Tue, 7 Mar 2017 14:01:34 +0800 Message-Id: <1488866494-10988-2-git-send-email-hesheng.chen@intel.com> X-Mailer: git-send-email 2.7.2.windows.1 In-Reply-To: <1488866494-10988-1-git-send-email-hesheng.chen@intel.com> References: <1488866494-10988-1-git-send-email-hesheng.chen@intel.com> Subject: [patch 2/2] BaseTools/UPT: Add a checkpoint for missing '"' X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Mar 2017 06:01:41 -0000 Add a checkpoint for UNI file which is missing '"' at the end of a line. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: hesschen --- BaseTools/Source/Python/UPT/Library/UniClassObject.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/UPT/Library/UniClassObject.py b/BaseTools/Source/Python/UPT/Library/UniClassObject.py index 27804cc..1fbbf2e 100644 --- a/BaseTools/Source/Python/UPT/Library/UniClassObject.py +++ b/BaseTools/Source/Python/UPT/Library/UniClassObject.py @@ -1,7 +1,7 @@ ## @file # Collect all defined strings in multiple uni files. # -# Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.
# # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD License which accompanies this @@ -558,7 +558,16 @@ class UniFileClassObject(object): Message="Cannot find include file", ExtraData=str(IncList[0])) continue - + + # + # Check if single line has correct '"' + # + if Line.startswith(u'#string') and Line.find(u'#language') > -1 and Line.find('"') > Line.find(u'#language'): + if not Line.endswith('"'): + EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID, + ExtraData='''The line %s misses '"' at the end of it in file %s''' + % (LineCount, File.Path)) + # # Between Name entry and Language entry can not contain line feed # -- 2.7.2.windows.1