summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2018-10-15 20:43:47 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-10-16 14:45:29 +0800
commit0fab42ba27c207c0fe268a435704b949d79e7725 (patch)
treed34f2145db9909eaf0329aa46d1d04ce43946f2e
parent03c36c36a3aaa9e8a6975ebdec35a9533d947ef5 (diff)
downloadedk2-0fab42ba27c207c0fe268a435704b949d79e7725.tar.gz
edk2-0fab42ba27c207c0fe268a435704b949d79e7725.tar.bz2
edk2-0fab42ba27c207c0fe268a435704b949d79e7725.zip
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>
-rw-r--r--BaseTools/Source/Python/Workspace/DscBuildData.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index f41038e26d..7854e71db6 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -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