summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeng, YunhuaX </o=Intel/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Feng, YunhuaX4e1>2018-02-06 10:19:49 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2018-02-07 09:28:44 +0800
commit8ad5f10a2be2c2c8dde111c0478b02da44a781e2 (patch)
treef81576cbfedc65c6bc95e54e69c336a5cb0ca792
parentf9bba77495750bb5f9bc5c5864b7c76fece5ec9f (diff)
downloadedk2-8ad5f10a2be2c2c8dde111c0478b02da44a781e2.zip
edk2-8ad5f10a2be2c2c8dde111c0478b02da44a781e2.tar.gz
edk2-8ad5f10a2be2c2c8dde111c0478b02da44a781e2.tar.bz2
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 <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
-rw-r--r--BaseTools/Source/Python/Common/Misc.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
index b8c2ce1..0365ac9 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)