From 85ea493fb78f988eabaa68c16ba5c95f498e5eff Mon Sep 17 00:00:00 2001 From: Hess Chen Date: Tue, 7 Mar 2017 14:01:34 +0800 Subject: [PATCH] BaseTools/UPT: Add a checkpoint for missing '"' 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: Hess Chen Reviewed-by: Yonghong Zhu --- .../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 27804cc9d8..1fbbf2e498 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.39.2