diff options
author | Jean Delvare <jdelvare@suse.de> | 2012-01-23 08:17:06 +0000 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2012-01-23 08:17:06 +0000 |
commit | 50eccc620f27971764ad67a372904ff8d5f48619 (patch) | |
tree | 2e51fb54da3c488c794d8ee62f26bc8726c4bcb2 /stub | |
parent | d0a411f46c0df511a0ac3092715665dafd8c914b (diff) | |
download | i2c-tools-git-50eccc620f27971764ad67a372904ff8d5f48619.tar.gz |
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
Diffstat (limited to 'stub')
-rwxr-xr-x | stub/i2c-stub-from-dump | 4 |
1 files changed, 2 insertions, 2 deletions
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 (<DUMP>) { - 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); |