summaryrefslogtreecommitdiffstats
path: root/convert
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-01-28 00:16:46 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-01-28 00:16:46 +0000
commit0a1f51ae36a1262ca95b74c6a28ccf00df467f6a (patch)
tree5099c690e9698a962c9945a3a404816ee977996e /convert
parentdca7aa82e74d2b5a65201878f339aa45019e69f4 (diff)
downloadldetect-lst-0a1f51ae36a1262ca95b74c6a28ccf00df467f6a.tar
ldetect-lst-0a1f51ae36a1262ca95b74c6a28ccf00df467f6a.tar.gz
ldetect-lst-0a1f51ae36a1262ca95b74c6a28ccf00df467f6a.tar.bz2
ldetect-lst-0a1f51ae36a1262ca95b74c6a28ccf00df467f6a.tar.xz
ldetect-lst-0a1f51ae36a1262ca95b74c6a28ccf00df467f6a.zip
read_pciids: make it more bullet proof
Diffstat (limited to 'convert')
-rwxr-xr-xconvert/merge2pcitable.pl12
1 files changed, 6 insertions, 6 deletions
diff --git a/convert/merge2pcitable.pl b/convert/merge2pcitable.pl
index 461639ea..0a79130b 100755
--- a/convert/merge2pcitable.pl
+++ b/convert/merge2pcitable.pl
@@ -113,20 +113,20 @@ sub read_pciids {
next if /^#/ || /^;/ || /^\s*$/;
if (/^C\s/) {
last;
- } elsif (my ($subid1, $subid2, $text) = /^\t\t(\S+)\s+(\S+)\s+(.*)/) {
+ } elsif (my ($subid1, $subid2, $text) = /^\t\t(\S+)\s+(\S+)\s+(.+)/) {
$text =~ s/\t/ /g;
$id1 && $id2 or die "$f $line: unexpected device\n";
- $drivers{lc "$id1$id2$subid1$subid2"} = [ "unknown", "$class|$text" ];
- } elsif (/^\t(\S+)\s+(.*)/) {
+ $drivers{sprintf qq(%04x%04x%04x%04x), hex($id1), hex($id2), hex($subid1), hex($subid2)} = [ "unknown", "$class|$text" ];
+ } elsif (/^\t(\S+)\s+(.+)/) {
($id2, $text) = ($1, $2);
$text =~ s/\t/ /g;
$id1 && $id2 or die "$f $line: unexpected device\n";
- $drivers{lc "$id1${id2}ffffffff"} = [ "unknown", "$class|$text" ];
- } elsif (/^(\S+)\s+(.*)/) {
+ $drivers{sprintf qq(%04x%04xffffffff), hex($id1), hex($id2)} = [ "unknown", "$class|$text" ];
+ } elsif (/^(\S+)\s+(.+)/) {
$id1 = $1;
$class = $class{$2} || $2;
} else {
- die "bad line: $_\n";
+ warn "bad line: $_\n";
}
}
\%drivers;