mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 23:54:02 +02:00
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>
This commit is contained in:
parent
f9bba77495
commit
8ad5f10a2b
@ -1603,7 +1603,8 @@ def ParseFieldValue (Value):
|
|||||||
Value = (Value << 8) | ((ItemValue >> 8 * I) & 0xff)
|
Value = (Value << 8) | ((ItemValue >> 8 * I) & 0xff)
|
||||||
return Value, RetSize
|
return Value, RetSize
|
||||||
if Value.startswith('DEVICE_PATH(') and Value.endswith(')'):
|
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)
|
return ParseDevPathValue(Value)
|
||||||
if Value.lower().startswith('0x'):
|
if Value.lower().startswith('0x'):
|
||||||
Value = int(Value, 16)
|
Value = int(Value, 16)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user