From 50eccc620f27971764ad67a372904ff8d5f48619 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 23 Jan 2012 08:17:06 +0000 Subject: [PATCH] i2c-stub-from-dump: Be more tolerant on input dump format Allow for uppercase hexadecimal digits, "|" instead of ":" as the address separator, and an optional space before said separator. i2cdump doesn't use any of these but other dump tools do, so this improves compatibility. git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@6013 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 3 +++ stub/i2c-stub-from-dump | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 97dde7b..7aae7e9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ i2c-tools CHANGES ----------------- +SVN HEAD + i2c-stub-from-dump: Be more tolerant on input dump format + 3.1.0 (2011-12-04) decode-dimms: Decode module configuration type of DDR SDRAM Decode refresh rate of DDR SDRAM diff --git a/stub/i2c-stub-from-dump b/stub/i2c-stub-from-dump index 7eb7ff8..4e35211 100755 --- a/stub/i2c-stub-from-dump +++ b/stub/i2c-stub-from-dump @@ -127,7 +127,7 @@ sub process_dump open(DUMP, $dump) || die "Can't open $dump: $!\n"; OUTER_LOOP: while () { - if (m/^([0-9a-f]0):(( [0-9a-fX]{2}){16})/) { + if (m/^([0-9a-f]0) ?[:|](( [0-9a-fX]{2}){16})/i) { # Byte dump my $offset = hex($1); my @values = split(/ /, $2); @@ -142,7 +142,7 @@ sub process_dump } $bytes++; } - } elsif (m/^([0-9a-f][08]):(( [0-9a-fX]{4}){8})/) { + } elsif (m/^([0-9a-f][08]) ?[:|](( [0-9a-fX]{4}){8})/i) { # Word dump my $offset = hex($1); my @values = split(/ /, $2);