summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/UPT/Library
diff options
context:
space:
mode:
authorFeng, Bob C <bob.c.feng@intel.com>2019-01-17 16:28:24 +0800
committerFeng, Bob C <bob.c.feng@intel.com>2019-02-18 09:11:46 +0800
commit8059cd2483f95f7fd021b0e93b28d90f932fc9f9 (patch)
tree8007a89bb09ed61ae8fdf76f3c7de8f726f50ba6 /BaseTools/Source/Python/UPT/Library
parent64a17fadcb79e2ce40524abb88a6863f47cbc0c7 (diff)
downloadedk2-8059cd2483f95f7fd021b0e93b28d90f932fc9f9.tar.gz
edk2-8059cd2483f95f7fd021b0e93b28d90f932fc9f9.tar.bz2
edk2-8059cd2483f95f7fd021b0e93b28d90f932fc9f9.zip
BaseTools: Correct the error message for UPT
This patch is going to correct the error message for UPT. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hess Chen <hess.chen@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/UPT/Library')
-rw-r--r--BaseTools/Source/Python/UPT/Library/UniClassObject.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/BaseTools/Source/Python/UPT/Library/UniClassObject.py b/BaseTools/Source/Python/UPT/Library/UniClassObject.py
index d575c6b1f8..35c416b5f1 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 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
@@ -597,6 +597,15 @@ class UniFileClassObject(object):
EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,
ExtraData='''The line %s misses '"' at the end of it in file %s'''
% (LineCount, File.Path))
+
+ #
+ # Check the situation that there has more than 2 '"' for the language entry
+ #
+ if Line.strip() and Line.replace(u'\\"', '').count(u'"') > 2:
+ EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,
+ ExtraData='''The line %s has more than 2 '"' for language entry in file %s'''
+ % (LineCount, File.Path))
+
elif Line.startswith(u'#language'):
if StringEntryExistsFlag == 2:
EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,
@@ -745,13 +754,6 @@ class UniFileClassObject(object):
else:
EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID, ExtraData=File.Path)
elif Line.startswith(u'"'):
- #
- # Check the situation that there has more than 2 '"' for the language entry
- #
- if Line.replace(u'\\"', '').count(u'"') > 2:
- EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,
- ExtraData='''The line %s has more than 2 '"' for language entry in file %s'''
- % (LineCount, File.Path))
if u'#string' in Line or u'#language' in Line:
EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID, ExtraData=File.Path)
NewLines.append(Line)