From 0fab42ba27c207c0fe268a435704b949d79e7725 Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Mon, 15 Oct 2018 20:43:47 +0800 Subject: [PATCH] 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 Reviewed-by: Jaben Carsey --- BaseTools/Source/Python/Workspace/DscBuildData.py | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.39.5