diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-02-20 15:54:55 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-02-20 15:54:55 +0000 |
commit | f08fee48350a3a081e9ea63dd52b728eef8fe958 (patch) | |
tree | 0730feee3d91bdb8afdd3086f9f6a2e501f86192 /convert/merge2pcitable.pl | |
parent | b5a644d0ed799400232fa786046ee053b800fda7 (diff) | |
download | ldetect-lst-f08fee48350a3a081e9ea63dd52b728eef8fe958.tar ldetect-lst-f08fee48350a3a081e9ea63dd52b728eef8fe958.tar.gz ldetect-lst-f08fee48350a3a081e9ea63dd52b728eef8fe958.tar.bz2 ldetect-lst-f08fee48350a3a081e9ea63dd52b728eef8fe958.tar.xz ldetect-lst-f08fee48350a3a081e9ea63dd52b728eef8fe958.zip |
- $rm_quote_silent was expecting $_ whereas we passed a parameter
- $rm_quote now expects a parameter
- add the line number in the data we collect
- modify to_string() to accept this 3rd element
Diffstat (limited to 'convert/merge2pcitable.pl')
-rwxr-xr-x | convert/merge2pcitable.pl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/convert/merge2pcitable.pl b/convert/merge2pcitable.pl index fd82c19e..71f6fa91 100755 --- a/convert/merge2pcitable.pl +++ b/convert/merge2pcitable.pl @@ -36,7 +36,7 @@ sub dummy_module { sub to_string { my ($id, $driver) = @_; - @$driver == 2 or error("error: to_string $id"); + @$driver >= 2 or error("error: to_string $id"); my ($module, $text) = map { qq("$_") } @$driver; my ($id1, $id2, $subid1, $subid2) = map { "0x$_" } ($id =~ /(....)/g); join "\t", $id1, $id2, "$subid1 $subid2" ne "0xffff 0xffff" ? ($subid1, $subid2) : (), $module, $text; @@ -48,8 +48,9 @@ sub read_pcitable { my ($f, $strict) = @_; my %drivers; my $line = 0; - my $rm_quote_silent = sub { s/^"//; s/"$//; $_ }; + my $rm_quote_silent = sub { local ($_) = @_; s/^"//; s/"$//; $_ }; my $rm_quote = sub { + local ($_) = @_; s/^"// or error("$f:$line: missing left quote"); s/"$// or error("$f:$line: missing right quote"); /"/ && $strict and error("$f:$line: bad double quote"); @@ -90,7 +91,7 @@ sub read_pcitable { lc($_); } $id1, $id2, $subid1, $subid2; $drivers{$id} && $strict and error("$f:$line: multiple entry for $id (skipping $module $text)"); - $drivers{$id} ||= [ map &$rm_quote, $module, $text ]; + $drivers{$id} ||= [ $rm_quote->($module), $rm_quote->($text), $line ]; } else { die "$f:$line: bad line\n"; } |