]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/UPT: Add a checkpoint for missing '"'
authorHess Chen <hesheng.chen@intel.com>
Tue, 7 Mar 2017 06:01:34 +0000 (14:01 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Thu, 9 Mar 2017 07:05:24 +0000 (15:05 +0800)
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 <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/UPT/Library/UniClassObject.py

index 27804cc9d8291d0538dd7b7be0fcf9cce8b90eb9..1fbbf2e498877864cb1a91f3883638b8d8ae33b0 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Collect all defined strings in multiple uni files.\r
 #\r
-# Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2014 - 2017, 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
@@ -558,7 +558,16 @@ class UniFileClassObject(object):
                                     Message="Cannot find include file", \r
                                     ExtraData=str(IncList[0]))\r
                 continue\r
-            \r
+\r
+            #\r
+            # Check if single line has correct '"'\r
+            #\r
+            if Line.startswith(u'#string') and Line.find(u'#language') > -1 and Line.find('"') > Line.find(u'#language'):\r
+                if not Line.endswith('"'):\r
+                    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
             # Between Name entry and Language entry can not contain line feed\r
             #\r