summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/UniClassObject.py
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-11-09 11:47:35 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-11-09 11:47:35 +0000
commitb303ea726e1c8ed240dad2bce54821318567eab3 (patch)
tree355db6226949afd1bfcc87d69e09a320ea9b7bb7 /BaseTools/Source/Python/AutoGen/UniClassObject.py
parent4c913fe619bd00861270cb0866feb34bcdc1592e (diff)
downloadedk2-b303ea726e1c8ed240dad2bce54821318567eab3.tar.gz
edk2-b303ea726e1c8ed240dad2bce54821318567eab3.tar.bz2
edk2-b303ea726e1c8ed240dad2bce54821318567eab3.zip
Sync tool code to BuildTools project r1739.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9397 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/UniClassObject.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/UniClassObject.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/Source/Python/AutoGen/UniClassObject.py
index 412fa72df0..dcfa264025 100644
--- a/BaseTools/Source/Python/AutoGen/UniClassObject.py
+++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py
@@ -234,6 +234,11 @@ class UniFileClassObject(object):
Value = ''
Name = Item.split()[1]
+ # Check the string name is the upper character
+ if not self.IsCompatibleMode and Name != '':
+ MatchString = re.match('[A-Z0-9_]+', Name, re.UNICODE)
+ if MatchString == None or MatchString.end(0) != len(Name):
+ EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'The string token name %s defined in UNI file %s contains the invalid lower case character.' %(Name, self.File))
LanguageList = Item.split(u'#language ')
for IndexI in range(len(LanguageList)):
if IndexI == 0:
@@ -365,6 +370,11 @@ class UniFileClassObject(object):
break
# Value = Value.replace(u'\r\n', u'')
Language = GetLanguageCode(Language, self.IsCompatibleMode, self.File)
+ # Check the string name is the upper character
+ if not self.IsCompatibleMode and Name != '':
+ MatchString = re.match('[A-Z0-9_]+', Name, re.UNICODE)
+ if MatchString == None or MatchString.end(0) != len(Name):
+ EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'The string token name %s defined in UNI file %s contains the invalid lower case character.' %(Name, self.File))
self.AddStringToList(Name, Language, Value)
continue