BaseTools: Fix bugs use special character in the --pcd option

Cases:
--pcd Token.Name="!"
--pcd Token.Name="\'W&\'"
--pcd Token.Name="2*h"

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
Yonghong Zhu 2018-10-15 20:43:47 +08:00
parent 03c36c36a3
commit 0fab42ba27
1 changed files with 2 additions and 0 deletions

View File

@ -1132,6 +1132,8 @@ class DscBuildData(PlatformBuildClassObject):
if not FieldName:
if PcdDatumType not in TAB_PCD_NUMERIC_TYPES:
PcdValue = '"' + PcdValue + '"'
elif not PcdValue.isdigit() and not PcdValue.upper().startswith('0X'):
PcdValue = '"' + PcdValue + '"'
else:
IsArray = False
Base = 10