From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A99BA2116DA3B for ; Mon, 15 Oct 2018 05:46:16 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Oct 2018 05:46:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,384,1534834800"; d="scan'208";a="95336035" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.127]) by fmsmga002.fm.intel.com with ESMTP; 15 Oct 2018 05:46:15 -0700 From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Mon, 15 Oct 2018 20:46:10 +0800 Message-Id: <1539607570-15996-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [Patch] BaseTools: Fix bugs use special character in the --pcd option X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2018 12:46:16 -0000 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 --- 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 aaef404..1a0a293 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1078,10 +1078,12 @@ class DscBuildData(PlatformBuildClassObject): if PcdValue.upper() == 'TRUE': PcdValue = str(1) 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 if PcdValue.upper().startswith('0X'): Base = 16 -- 2.6.1.windows.1