From: Feng, YunhuaX Date: Tue, 6 Feb 2018 02:19:49 +0000 (+0800) Subject: BaseTools: Fix flexible PCD DEVICE_PATH parse issue X-Git-Tag: edk2-stable201903~2457 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=8ad5f10a2be2c2c8dde111c0478b02da44a781e2;ds=sidebyside BaseTools: Fix flexible PCD DEVICE_PATH parse issue When the format of DEVICE_PATH have string, like as: {DEVICE_PATH("BBS(1,"AB",0)")} have string "AB", will get the wrong value. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng Reviewed-by: Yonghong Zhu --- diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py index b8c2ce1ddc..0365ac9531 100644 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -1603,7 +1603,8 @@ def ParseFieldValue (Value): Value = (Value << 8) | ((ItemValue >> 8 * I) & 0xff) return Value, RetSize if Value.startswith('DEVICE_PATH(') and Value.endswith(')'): - Value = Value.split('"')[1] + Value = Value.replace("DEVICE_PATH(", '').rstrip(')') + Value = Value.strip().strip('"') return ParseDevPathValue(Value) if Value.lower().startswith('0x'): Value = int(Value, 16)