aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2021-12-20 16:56:59 +0100
committerMartin Mares <mj@ucw.cz>2021-12-26 22:57:57 +0100
commit006ca87f517a8cf6d4629b04e5d5b14f731fc32e (patch)
treee8138df7fa93cec09640173a460a4c7cfe659d38
parent63435b6e6e96b59b00cff31138603dadd1ec183a (diff)
downloadpciutils-006ca87f517a8cf6d4629b04e5d5b14f731fc32e.tar.gz
dump: Allow more leading zeros in dump line number
U-Boot's "pci display.b" command prints pci config space dump with 8 digits in line number. So allow up to the 8 digits in line number to easily parse U-Boot's pci config space dumps.
-rw-r--r--lib/dump.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/dump.c b/lib/dump.c
index 879c624..c0f9291 100644
--- a/lib/dump.c
+++ b/lib/dump.c
@@ -90,7 +90,9 @@ dump_init(struct pci_access *a)
else if (!len)
dev = NULL;
else if (dev &&
- (dump_validate(buf, "##: ") || dump_validate(buf, "###: ")) &&
+ (dump_validate(buf, "##: ") || dump_validate(buf, "###: ") || dump_validate(buf, "####: ") ||
+ dump_validate(buf, "#####: ") || dump_validate(buf, "######: ") ||
+ dump_validate(buf, "#######: ") || dump_validate(buf, "########: ")) &&
sscanf(buf, "%x: ", &i) == 1)
{
struct dump_data *dd = dev->aux;