summaryrefslogtreecommitdiff
path: root/stub
diff options
context:
space:
mode:
authorkhali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0>2012-01-23 08:17:06 +0000
committerkhali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0>2012-01-23 08:17:06 +0000
commit2e88acbe1629a52daaa6d34493dc3560dc801e62 (patch)
tree2e51fb54da3c488c794d8ee62f26bc8726c4bcb2 /stub
parentaaecd008cc2b113515bd851c8b90ffbe223f0a6e (diff)
downloadi2c-tools-2e88acbe1629a52daaa6d34493dc3560dc801e62.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-xstub/i2c-stub-from-dump4
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);