]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Correct the error message for UPT
authorFeng, Bob C <bob.c.feng@intel.com>
Thu, 17 Jan 2019 08:28:24 +0000 (16:28 +0800)
committerFeng, Bob C <bob.c.feng@intel.com>
Mon, 18 Feb 2019 01:11:46 +0000 (09:11 +0800)
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>
BaseTools/Source/Python/UPT/Library/UniClassObject.py

index d575c6b1f87562a4c9346db5017145dd5527abd8..35c416b5f1e59ab19f73a4bb783ac8e5675a6a98 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Collect all defined strings in multiple uni files.\r
 #\r
-# Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials are licensed and made available\r
 # under the terms and conditions of the BSD License which accompanies this\r
@@ -597,6 +597,15 @@ class UniFileClassObject(object):
                     EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,\r
                                     ExtraData='''The line %s misses '"' at the end of it in file %s'''\r
                                               % (LineCount, File.Path))\r
+\r
+                #\r
+                # Check the situation that there has more than 2 '"' for the language entry\r
+                #\r
+                if Line.strip() and Line.replace(u'\\"', '').count(u'"') > 2:\r
+                    EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,\r
+                                    ExtraData='''The line %s has more than 2 '"' for language entry in file %s'''\r
+                                    % (LineCount, File.Path))\r
+\r
             elif Line.startswith(u'#language'):\r
                 if StringEntryExistsFlag == 2:\r
                     EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,\r
@@ -745,13 +754,6 @@ class UniFileClassObject(object):
                 else:\r
                     EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID, ExtraData=File.Path)\r
             elif Line.startswith(u'"'):\r
-                #\r
-                # Check the situation that there has more than 2 '"' for the language entry\r
-                #\r
-                if Line.replace(u'\\"', '').count(u'"') > 2:\r
-                    EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,\r
-                                    ExtraData='''The line %s has more than 2 '"' for language entry in file %s'''\r
-                                    % (LineCount, File.Path))\r
                 if u'#string' in Line  or u'#language' in Line:\r
                     EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID, ExtraData=File.Path)\r
                 NewLines.append(Line)\r